[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/10: tests: basic: Wait for /var/run/shepherd/socket to be ready.
From: |
Ludovic Courtès |
Subject: |
07/10: tests: basic: Wait for /var/run/shepherd/socket to be ready. |
Date: |
Tue, 3 Jul 2018 11:50:15 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 3c78f5b5c341aa741a39417e6007dbaf369438f8
Author: Ludovic Courtès <address@hidden>
Date: Tue Jul 3 15:29:37 2018 +0200
tests: basic: Wait for /var/run/shepherd/socket to be ready.
* gnu/tests/base.scm (run-basic-test)["shepherd socket ready"]: New test.
---
gnu/tests/base.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 4c24cf5..0efb4a6 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -100,6 +100,23 @@ initialization step, such as entering a LUKS passphrase."
version)
(string-prefix? architecture %host-type)))))
+ ;; Shepherd reads the config file *before* binding its control
+ ;; socket, so /var/run/shepherd/socket might not exist yet when the
+ ;; 'marionette' service is started.
+ (test-assert "shepherd socket ready"
+ (marionette-eval
+ `(begin
+ (use-modules (gnu services herd))
+ (let loop ((i 10))
+ (cond ((file-exists? (%shepherd-socket-file))
+ #t)
+ ((> i 0)
+ (sleep 1)
+ (loop (- i 1)))
+ (else
+ #f))))
+ marionette))
+
(test-assert "shell and user commands"
;; Is everything in $PATH?
(zero? (marionette-eval '(system "
- branch master updated (13f5eb3 -> a51cf16), Ludovic Courtès, 2018/07/03
- 02/10: syscalls: Define AT_SYMLINK_NOFOLLOW et al., Ludovic Courtès, 2018/07/03
- 01/10: deduplication: Remove 'false-if-system-error', now unused., Ludovic Courtès, 2018/07/03
- 03/10: database: 'reset-timestamps' now correctly handles symlinks., Ludovic Courtès, 2018/07/03
- 04/10: ui: Report file names in 'system-error' exceptions from 'delete-file'., Ludovic Courtès, 2018/07/03
- 05/10: guix system: Make 'init' idempotent again., Ludovic Courtès, 2018/07/03
- 07/10: tests: basic: Wait for /var/run/shepherd/socket to be ready.,
Ludovic Courtès <=
- 06/10: Revert "packages: Optimize 'package-transitive-supported-systems'.", Ludovic Courtès, 2018/07/03
- 10/10: gnu: Update stellarium to 0.18.0., Ludovic Courtès, 2018/07/03
- 08/10: gnu: Add pocl., Ludovic Courtès, 2018/07/03
- 09/10: gnu: emacs-helm-system-packages: Update to 1.10.0., Ludovic Courtès, 2018/07/03