summary refs log tree commit diff
path: root/gnu/tests/base.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2016-11-23 22:24:52 -0500
committerLeo Famulari <leo@famulari.name>2016-11-23 22:24:52 -0500
commit2ac7d54616819c65405ea27260dbff462160f290 (patch)
tree4c82001f0855ebab05ab342e342a680c533b9bf9 /gnu/tests/base.scm
parent61320932edb42e78fb377b5d11cd6ecb32e2f9e6 (diff)
parent1c9f78eca1f7e169562abaaa882fd94d845208af (diff)
downloadguix-2ac7d54616819c65405ea27260dbff462160f290.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/tests/base.scm')
-rw-r--r--gnu/tests/base.scm20
1 files changed, 13 insertions, 7 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 5c2af5b6d4..9a265309c0 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -150,14 +150,20 @@ info --version")
               (marionette-type "root\n\nid -un > logged-in\n" marionette)
 
               ;; It can take a while before the shell commands are executed.
-              (let loop ((i 0))
-                (unless (or (file-exists? "/root/logged-in") (> i 15))
-                  (sleep 1)
-                  (loop (+ i 1))))
               (marionette-eval '(use-modules (rnrs io ports)) marionette)
-              (marionette-eval '(call-with-input-file "/root/logged-in"
-                                  get-string-all)
-                               marionette)))
+              (marionette-eval
+               '(let loop ((i 0))
+                  (catch 'system-error
+                    (lambda ()
+                      (call-with-input-file "/root/logged-in"
+                        get-string-all))
+                    (lambda args
+                      (if (and (< i 15) (= ENOENT (system-error-errno args)))
+                          (begin
+                            (sleep 1)
+                            (loop (+ i 1)))
+                          (apply throw args)))))
+               marionette)))
 
           (test-assert "host name resolution"
             (match (marionette-eval