diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-06-18 15:29:38 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-06-18 15:29:38 +0200 |
commit | 6969c4de445a390eaa05de22bc5a537a76a76169 (patch) | |
tree | 9df3bdde497fdce705ae4eb66972f93a9ae111d9 /gnu/tests/base.scm | |
parent | 73d18915b597f2a386d6ae42930b49a13c8813b0 (diff) | |
parent | 32eb44240db23b2320a68a3ab17370531945587f (diff) | |
download | patches-6969c4de445a390eaa05de22bc5a537a76a76169.tar patches-6969c4de445a390eaa05de22bc5a537a76a76169.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/tests/base.scm')
-rw-r--r-- | gnu/tests/base.scm | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 3faeddef6c..05c846264d 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -517,13 +518,11 @@ in a loop. See <http://bugs.gnu.org/26931>.") (test-begin "mcron") - (test-eq "service running" - 'running! + (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd)) - (start-service 'mcron) - 'running!) + (start-service 'mcron)) marionette)) ;; Make sure root's mcron job runs, has its cwd set to "/root", and @@ -619,32 +618,43 @@ in a loop. See <http://bugs.gnu.org/26931>.") (test-begin "avahi") - (test-assert "wait for services" + (test-assert "nscd PID file is created" (marionette-eval '(begin (use-modules (gnu services herd)) + (start-service 'nscd)) + marionette)) + + (test-assert "nscd is listening on its socket" + (marionette-eval + ;; XXX: Work around a race condition in nscd: nscd creates its + ;; PID file before it is listening on its socket. + '(let ((sock (socket PF_UNIX SOCK_STREAM 0))) + (let try () + (catch 'system-error + (lambda () + (connect sock AF_UNIX "/var/run/nscd/socket") + (close-port sock) + (format #t "nscd is ready~%") + #t) + (lambda args + (format #t "waiting for nscd...~%") + (usleep 500000) + (try))))) + marionette)) + + (test-assert "avahi is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'avahi-daemon)) + marionette)) - (start-service 'nscd) - - ;; XXX: Work around a race condition in nscd: nscd creates its - ;; PID file before it is listening on its socket. - (let ((sock (socket PF_UNIX SOCK_STREAM 0))) - (let try () - (catch 'system-error - (lambda () - (connect sock AF_UNIX "/var/run/nscd/socket") - (close-port sock) - (format #t "nscd is ready~%")) - (lambda args - (format #t "waiting for nscd...~%") - (usleep 500000) - (try))))) - - ;; Wait for the other useful things. - (start-service 'avahi-daemon) - (start-service 'networking) - - #t) + (test-assert "network is up" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'networking)) marionette)) (test-equal "avahi-resolve-host-name" |