summaryrefslogtreecommitdiff
path: root/gnu/tests/nfs.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests/nfs.scm')
-rw-r--r--gnu/tests/nfs.scm36
1 files changed, 7 insertions, 29 deletions
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index 014d049ab5..00109b752e 100644
--- a/gnu/tests/nfs.scm
+++ b/gnu/tests/nfs.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -101,6 +101,10 @@
(marionette-eval
'(begin
(use-modules (gnu services herd))
+
+ ;; Ensure 'rpcinfo' can be found below.
+ (setenv "PATH" "/run/current-system/profile/bin")
+
(start-service 'rpcbind-daemon))
marionette))
@@ -192,18 +196,6 @@
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (define (wait-for-file file)
- ;; Wait until FILE exists in the guest
- (marionette-eval
- `(let loop ((i 10))
- (cond ((file-exists? ,file)
- #t)
- ((> i 0)
- (sleep 1)
- (loop (- i 1)))
- (else
- (error "File didn't show up: " ,file))))
- marionette))
(mkdir #$output)
(chdir #$output)
@@ -227,22 +219,8 @@
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))
+ (wait-for-unix-socket "/var/run/nscd/socket"
+ marionette))
(test-assert "network is up"
(marionette-eval