From patchwork Fri Dec 15 21:02:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 57622 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 40C3A27BBEA; Fri, 15 Dec 2023 21:03:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 963FB27BBE2 for ; Fri, 15 Dec 2023 21:03:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEFKz-0000sn-Lz; Fri, 15 Dec 2023 16:03:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEFKo-0000rP-SR for guix-patches@gnu.org; Fri, 15 Dec 2023 16:03:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEFKo-0006KR-HY for guix-patches@gnu.org; Fri, 15 Dec 2023 16:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEFKo-0003UK-IH for guix-patches@gnu.org; Fri, 15 Dec 2023 16:03:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67842] [PATCH 2/4] tests: mympd: Simplify test. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 15 Dec 2023 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67842@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 67842-submit@debbugs.gnu.org id=B67842.170267417213356 (code B ref 67842); Fri, 15 Dec 2023 21:03:02 +0000 Received: (at 67842) by debbugs.gnu.org; 15 Dec 2023 21:02:52 +0000 Received: from localhost ([127.0.0.1]:53640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEFKe-0003TM-AB for submit@debbugs.gnu.org; Fri, 15 Dec 2023 16:02:52 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:55370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEFKc-0003TD-Ha for 67842@debbugs.gnu.org; Fri, 15 Dec 2023 16:02:51 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 65B4720D7F for <67842@debbugs.gnu.org>; Fri, 15 Dec 2023 22:02:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id CCEA880098; Fri, 15 Dec 2023 22:02:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MyBZJJT7QwtP; Fri, 15 Dec 2023 22:02:48 +0100 (CET) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 29FF280067; Fri, 15 Dec 2023 22:02:48 +0100 (CET) From: Bruno Victal Date: Fri, 15 Dec 2023 21:02:37 +0000 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/tests/audio.scm: (run-mympd-test): Restyle. Remove dhcp-client-service-type. Remove port-forwards and refactor http-head test to happen within the VM instead of the host. --- gnu/tests/audio.scm | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm index acb91293e8..a0ab54da2a 100644 --- a/gnu/tests/audio.scm +++ b/gnu/tests/audio.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Peter Mikkelsen -;;; Copyright © 2022 Bruno Victal +;;; Copyright © 2022⁠–⁠2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -81,23 +81,17 @@ (define %test-mpd (value (run-mpd-test)))) (define (run-mympd-test) - (define os (marionette-operating-system - (simple-operating-system (service dhcp-client-service-type) - (service mympd-service-type)) - #:imported-modules '((gnu services herd)))) + (define os + (marionette-operating-system + (simple-operating-system (service mympd-service-type)) + #:imported-modules '((gnu services herd)))) - (define vm - (virtual-machine - (operating-system os) - (port-forwardings '((8080 . 80))))) + (define vm (virtual-machine os)) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (srfi srfi-64) - (srfi srfi-8) - (web client) - (web response) (gnu build marionette)) (define marionette @@ -106,18 +100,23 @@ (define (run-mympd-test) (test-runner-current (system-test-runner #$output)) (test-begin "mympd") (test-assert "service is running" - (marionette-eval '(begin - (use-modules (gnu services herd)) - - (start-service 'mympd)) - marionette)) + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'mympd)) + marionette)) (test-assert "HTTP port ready" (wait-for-tcp-port 80 marionette)) (test-equal "http-head" 200 - (receive (x _) (http-head "http://localhost:8080") (response-code x))) + (marionette-eval + '(begin + (use-modules (web client) + (web response)) + (response-code (http-head "http://localhost"))) + marionette)) (test-end)))) (gexp->derivation "mympd-test" test))