all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: 67842@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>
Subject: [bug#67842] [PATCH 2/4] tests: mympd: Simplify test.
Date: Fri, 15 Dec 2023 21:02:37 +0000	[thread overview]
Message-ID: <f3bc7f8d4223186255f2e874b9939fe2edbc963a.1702663151.git.mirai@makinata.eu> (raw)
In-Reply-To: <cover.1702663151.git.mirai@makinata.eu>

* 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 <petermikkelsen10@gmail.com>
-;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2022⁠–⁠2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; 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))
-- 
2.41.0





  parent reply	other threads:[~2023-12-15 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 20:59 [bug#67842] [PATCH 0/4] Refactor mympd service Bruno Victal
2023-12-15 21:02 ` [bug#67842] [PATCH 1/4] doc: Remove missed hunk of revert commit for MPD service Bruno Victal
2023-12-15 21:02 ` Bruno Victal [this message]
2023-12-15 21:02 ` [bug#67842] [PATCH 3/4] services: mympd: Fix syslog logging and missing service destructor Bruno Victal
2023-12-15 21:02 ` [bug#67842] [PATCH 4/4] services: mympd: Refactor serialization process Bruno Victal
2023-12-16  1:44   ` Liliana Marie Prikler
2023-12-16 19:36     ` Bruno Victal
2023-12-16 22:12       ` Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3bc7f8d4223186255f2e874b9939fe2edbc963a.1702663151.git.mirai@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=67842@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.