aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-11-17 23:14:58 +0100
committerLudovic Courtès <ludo@gnu.org>2016-11-17 23:21:48 +0100
commit056d0b40341a1b28516a6c2e0fed820360be42b5 (patch)
tree6e7712d2ce6d07b7551ad165c51e24d8aca69628 /gnu/tests
parente9ff8d9ff15db2917d7200cda2bb68a52a9b19b0 (diff)
downloadgnu-guix-056d0b40341a1b28516a6c2e0fed820360be42b5.tar
gnu-guix-056d0b40341a1b28516a6c2e0fed820360be42b5.tar.gz
tests: basic: Fix harmless thinko.
* gnu/tests/base.scm (run-basic-test)["login on tty1"]: Move the file-waiting loop inside the 'marionette-eval' body. Before that, we were waiting for the file to appear on the host, which would never happen, meaning that we were always waiting for 15 seconds.
Diffstat (limited to 'gnu/tests')
-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