mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
tests: nfs-server: Use marionette helper procedures.
* gnu/tests/nfs.scm (run-nfs-server-test)[test](wait-for-file): Remove. ("nscd is listening on its socket"): Use 'wait-for-unix-socket'.
This commit is contained in:
parent
8a65ca6f8c
commit
a55472955d
1 changed files with 2 additions and 28 deletions
|
@ -196,18 +196,6 @@ (define test
|
|||
|
||||
(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)
|
||||
|
@ -231,22 +219,8 @@ (define (wait-for-file file)
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue