diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-11-06 23:12:12 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-11-06 23:14:14 +0100 |
commit | 9909eddbc55c6cac5acccab453993cd113aa38a1 (patch) | |
tree | 012549382939666896c9c7f4cb18dafcdd77997b /gnu/tests/audio.scm | |
parent | bb124f6e9c0af0a23736f233c2ea2c9c9b4a40a6 (diff) |
tests: mpd: Remove race condition; use default MPD configuration.
* gnu/tests/audio.scm (%mpd-os): Use the default 'mpd-configuration'.
(run-mpd-test)[test]("mpd listening"): New test.
("mpc connect"): Use 'system*' and 'test-equal'.
Diffstat (limited to 'gnu/tests/audio.scm')
-rw-r--r-- | gnu/tests/audio.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm index 8eadaf02e1..7bf7d4ef14 100644 --- a/gnu/tests/audio.scm +++ b/gnu/tests/audio.scm @@ -28,9 +28,7 @@ (define %mpd-os (simple-operating-system - (service mpd-service-type - (mpd-configuration - (user "root"))))) + (service mpd-service-type))) (define (run-mpd-test) "Run tests in %mpd-os, which has mpd running." @@ -62,9 +60,14 @@ (start-service 'mpd)) marionette)) - (test-assert "mpc connect" + (test-assert "mpd listening" + ;; Wait until mpd is actually listening before spawning 'mpc'. + (wait-for-tcp-port 6600 marionette)) + + (test-equal "mpc connect" + 0 (marionette-eval - '(zero? (system #$(file-append mpd-mpc "/bin/mpc"))) + '(system* #$(file-append mpd-mpc "/bin/mpc")) marionette)) (test-end) |