mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
tests: dhcpd: Avoid race conditions.
Those tests were racy: it could take a while for those files to appear and for the shepherd service to be up. Thus, wait a little longer for each of them. * gnu/tests/networking.scm (run-dhcpd-test)["pid file exists"] ["lease file exists"]: Use 'wait-for-file'. ["dhcpd is alive"]: Use 'wait-for-service'.
This commit is contained in:
parent
da6e6d38f3
commit
8aaa5cf405
1 changed files with 8 additions and 16 deletions
|
@ -412,8 +412,6 @@ (define test
|
|||
(with-imported-modules '((gnu build marionette))
|
||||
#~(begin
|
||||
(use-modules (gnu build marionette)
|
||||
(ice-9 popen)
|
||||
(ice-9 rdelim)
|
||||
(srfi srfi-64))
|
||||
|
||||
(define marionette
|
||||
|
@ -423,16 +421,15 @@ (define marionette
|
|||
(test-begin "dhcpd")
|
||||
|
||||
(test-assert "pid file exists"
|
||||
(marionette-eval
|
||||
'(file-exists?
|
||||
#$(dhcpd-configuration-pid-file dhcpd-v4-configuration))
|
||||
(wait-for-file
|
||||
'#$(dhcpd-configuration-pid-file dhcpd-v4-configuration)
|
||||
marionette))
|
||||
|
||||
(test-assert "lease file exists"
|
||||
(marionette-eval
|
||||
'(file-exists?
|
||||
#$(dhcpd-configuration-lease-file dhcpd-v4-configuration))
|
||||
marionette))
|
||||
(wait-for-file
|
||||
'#$(dhcpd-configuration-lease-file dhcpd-v4-configuration)
|
||||
marionette
|
||||
#:read '(@ (ice-9 textual-ports) get-string-all)))
|
||||
|
||||
(test-assert "run directory exists"
|
||||
(marionette-eval
|
||||
|
@ -443,13 +440,8 @@ (define marionette
|
|||
(test-assert "dhcpd is alive"
|
||||
(marionette-eval
|
||||
'(begin
|
||||
(use-modules (gnu services herd)
|
||||
(srfi srfi-1))
|
||||
(live-service-running
|
||||
(find (lambda (live)
|
||||
(memq 'dhcpv4-daemon
|
||||
(live-service-provision live)))
|
||||
(current-services))))
|
||||
(use-modules (gnu services herd))
|
||||
(wait-for-service 'dhcpv4-daemon))
|
||||
marionette))
|
||||
|
||||
(test-end))))
|
||||
|
|
Loading…
Reference in a new issue