From 13877c34534fc6a1cda25a984007bc0e7d27ebc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 7 Sep 2017 23:31:21 +0200 Subject: 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. --- gnu/tests/base.scm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'gnu/tests/base.scm') 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" -- cgit v1.2.3 From 077f1e6384fbd28ffd02e9e10a413bb3c24aaa15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 26 Sep 2017 10:09:53 +0200 Subject: tests: mcron: Adjust use of 'wait-for-file'. Fixes a regression introduced in 8bd5231485cdeb02078c4294badb3a1e7caa0fe0, whereby returning # would no longer work (since # would be in the cdr of the result, and thus it would not get converted to a string.) * gnu/tests/base.scm (run-mcron-test)["root's job with command"]: Pass #:read to 'wait-for-file'. --- gnu/tests/base.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/tests/base.scm') diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 959da31a60..1bc7a70277 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -544,11 +544,11 @@ in a loop. See .") (>= gid 100)))) ;; Last, the job that uses a command; allows us to test whether - ;; $PATH is sane. (Note that 'marionette-eval' stringifies objects - ;; that don't have a read syntax, hence the string.) + ;; $PATH is sane. (test-equal "root's job with command" - "#" - (wait-for-file "/root/witness-touch" marionette)) + "" + (wait-for-file "/root/witness-touch" marionette + #:read '(@ (ice-9 rdelim) read-string))) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) -- cgit v1.2.3