summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-02-23 11:54:53 +0100
committerMathieu Othacehe <othacehe@gnu.org>2021-02-23 11:54:53 +0100
commit0de0074844f3391c7c85537f66bfcab288dce8dc (patch)
treed1e22a2d2705755e196af4acd45d0ce30dfe4936
parentab054868afe6a4ba9d8aa9943e265bd6a871d0ae (diff)
downloadguix-0de0074844f3391c7c85537f66bfcab288dce8dc.tar.gz
tests: cuirass: Restore "cuirass running".
This is a follow-up of ab054868afe6a4ba9d8aa9943e265bd6a871d0ae. The test was
failing because the Shepherd control socket wasn't ready yet. Restore it but
make sure that the control socket is available first.

* gnu/tests/cuirass.scm ("shepherd socket ready"): New test.
("cuirass running"): Restore it.
-rw-r--r--gnu/tests/cuirass.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/tests/cuirass.scm b/gnu/tests/cuirass.scm
index 4aa7a29cfb..04a7a71dcf 100644
--- a/gnu/tests/cuirass.scm
+++ b/gnu/tests/cuirass.scm
@@ -191,6 +191,32 @@
 
             (test-begin "cuirass")
 
+            ;; XXX: 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
+                           'failure))))
+               marionette))
+
+            ;; Wait for cuirass to be up and running.
+            (test-assert "cuirass running"
+              (marionette-eval
+               '(begin
+                  (use-modules (gnu services herd))
+                  (start-service 'cuirass)
+                  #t)
+               marionette))
+
             (test-assert "cuirass-web running"
               (begin
                 (wait-for-tcp-port #$cuirass-web-port marionette)