[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: tests: dhcpd: Avoid race conditions.
From: |
guix-commits |
Subject: |
01/08: tests: dhcpd: Avoid race conditions. |
Date: |
Sun, 14 May 2023 17:21:02 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 8aaa5cf40539b3634be744700bbe246c69c8ddbf
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun May 14 22:35:30 2023 +0200
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'.
---
gnu/tests/networking.scm | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm
index a8358c6a55..a192c7e655 100644
--- a/gnu/tests/networking.scm
+++ b/gnu/tests/networking.scm
@@ -412,8 +412,6 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(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 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(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 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(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))))
- branch master updated (da6e6d38f3 -> c5fa9dd0e9), guix-commits, 2023/05/14
- 02/08: tests: elogind: Wait until 'elogind' is up., guix-commits, 2023/05/14
- 06/08: gnu: python-agate: Update to 1.7.1, guix-commits, 2023/05/14
- 04/08: gnu: python-agate-sql: Update to 0.5.9., guix-commits, 2023/05/14
- 05/08: gnu: Add python-agate-locales., guix-commits, 2023/05/14
- 08/08: gnu: cmus: Enable MPRIS support., guix-commits, 2023/05/14
- 03/08: gnu: python-agate-dbf: Update to 0.2.2., guix-commits, 2023/05/14
- 07/08: gnu: csvkit: Update to 1.1.1., guix-commits, 2023/05/14
- 01/08: tests: dhcpd: Avoid race conditions.,
guix-commits <=