diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-12-18 14:51:56 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-12-18 16:04:26 +0100 |
commit | 6ea6e1476ff4a18d4b4b864c3065d18ed99c69af (patch) | |
tree | 00cb5c5767ae74f8f6c5f22f4ba949206db81157 /gnu/tests | |
parent | 65c8a043709e9e13f814211bba98c57eb00d9620 (diff) | |
download | gnu-guix-6ea6e1476ff4a18d4b4b864c3065d18ed99c69af.tar gnu-guix-6ea6e1476ff4a18d4b4b864c3065d18ed99c69af.tar.gz |
file-systems: Spawn a REPL only when interaction is possible.
Fixes <https://bugs.gnu.org/23697>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.
* gnu/build/file-systems.scm (check-file-system): Call 'start-repl' only
if current-input-port passes 'isatty?'.
* gnu/services/shepherd.scm (shepherd-configuration-file): After
'for-each' expression, call 'redirect-port'.
* gnu/tests/base.scm (run-basic-test)["stdin is /dev/null"]: New test.
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/base.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 03392cef38..8d4e218a8f 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -123,6 +123,21 @@ initialization step, such as entering a LUKS passphrase." #f)))) marionette)) + (test-eq "stdin is /dev/null" + 'eof + ;; Make sure services can no longer read from stdin once the + ;; system has booted. + (marionette-eval + `(begin + (use-modules (gnu services herd)) + (start 'user-processes) + ((@@ (gnu services herd) eval-there) + '(let ((result (read (current-input-port)))) + (if (eof-object? result) + 'eof + result)))) + marionette)) + (test-assert "shell and user commands" ;; Is everything in $PATH? (zero? (marionette-eval '(system " |