aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-09-07 23:31:21 +0200
committerLudovic Courtès <ludo@gnu.org>2017-09-08 00:11:21 +0200
commit13877c34534fc6a1cda25a984007bc0e7d27ebc9 (patch)
treef1b8da83983b74f8106978ead2810f8c581933cf /gnu/tests
parent505760ed08db7399bf5a21fd04272079fe7bca19 (diff)
downloadguix-13877c34534fc6a1cda25a984007bc0e7d27ebc9.tar.gz
guix-13877c34534fc6a1cda25a984007bc0e7d27ebc9.zip
marionette: 'wait-for-file' can be passed a read procedure.
* gnu/build/marionette.scm (wait-for-file): Add #:read parameter and honor it. * gnu/tests/base.scm (run-basic-test)["login on tty1"]: Use 'wait-for-file' instead of inline code.
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/base.scm15
1 files changed, 2 insertions, 13 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 5b40d4514a..959da31a60 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -250,19 +250,8 @@ info --version")
;; It can take a while before the shell commands are executed.
(marionette-eval '(use-modules (rnrs io ports)) 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)))
+ (wait-for-file "/root/logged-in" marionette
+ #:read 'get-string-all)))
;; There should be one utmpx entry for the user logged in on tty1.
(test-equal "utmpx entry"