summaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-02-08 09:41:45 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-02-08 09:41:45 -0500
commitd88cee1d44a475b6ea276e87a4c98682255b881e (patch)
treef2e681b5211840d4eef688120041c2dd730002cc /gnu/tests
parentd2b9b4b861b71d11eaeaa12fe544c9ffb0b6644d (diff)
parent20059f92a97726b40d4d74e67463a64c98d1da0d (diff)
Merge branch 'master' into staging.
With conflicts resolved in: gnu/packages/version-control.scm
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/audio.scm53
-rw-r--r--gnu/tests/web.scm7
2 files changed, 55 insertions, 5 deletions
diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm
index 8aa6d1e818..acb91293e8 100644
--- a/gnu/tests/audio.scm
+++ b/gnu/tests/audio.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
+;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,9 +23,11 @@
#:use-module (gnu system vm)
#:use-module (gnu services)
#:use-module (gnu services audio)
+ #:use-module (gnu services networking)
#:use-module (gnu packages mpd)
#:use-module (guix gexp)
- #:export (%test-mpd))
+ #:export (%test-mpd
+ %test-mympd))
(define %mpd-os
(simple-operating-system
@@ -76,3 +79,51 @@
(name "mpd")
(description "Test that the mpd can run and be connected to.")
(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 vm
+ (virtual-machine
+ (operating-system os)
+ (port-forwardings '((8080 . 80)))))
+
+ (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
+ (make-marionette (list #$vm)))
+
+ (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))
+
+ (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)))
+
+ (test-end))))
+ (gexp->derivation "mympd-test" test))
+
+(define %test-mympd
+ (system-test
+ (name "mympd")
+ (description "Connect to a running myMPD service.")
+ (value (run-mympd-test))))
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm
index 7a585e618d..16dc6bea49 100644
--- a/gnu/tests/web.scm
+++ b/gnu/tests/web.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2020-2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2020-2021, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
@@ -419,9 +419,8 @@ HTTP-PORT, along with php-fpm."
(define %hpcguix-web-specs
;; Server config gexp.
- #~(define site-config
- (hpcweb-configuration
- (title-prefix "[TEST] HPCGUIX-WEB"))))
+ #~(hpcweb-configuration
+ (title-prefix "[TEST] HPCGUIX-WEB")))
(define %hpcguix-web-os
(simple-operating-system