diff options
author | Leo Famulari <leo@famulari.name> | 2017-06-04 14:56:31 -0400 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2017-06-04 14:56:31 -0400 |
commit | 9f825cec1beb0174a218ee3af603a692e5aea81d (patch) | |
tree | 16dd2359f73965bb015a89daa76af4ca1ba2e500 /tests | |
parent | 8b4186e116434860a93fd1c8163fdeb86c1d63a8 (diff) | |
parent | cc24bf98bd9b57e7f5653858c1a54283a490cbd0 (diff) | |
download | patches-9f825cec1beb0174a218ee3af603a692e5aea81d.tar patches-9f825cec1beb0174a218ee3af603a692e5aea81d.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r-- | tests/guix-daemon.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh index fde49e25a2..9186ffd585 100644 --- a/tests/guix-daemon.sh +++ b/tests/guix-daemon.sh @@ -145,3 +145,39 @@ guile -c ' (exit (= 42 (pk (call-with-input-file (derivation->output-path drv) read)))))))' + + +kill "$daemon_pid" + +# Make sure the daemon's default 'timeout' and 'max-silent-time' settings are +# honored. + +client_code=' + (use-modules (guix) (gnu packages) (guix tests) (srfi srfi-34)) + + (with-store store + (let* ((build (add-text-to-store store "build.sh" + "while true ; do : ; done")) + (bash (add-to-store store "bash" #t "sha256" + (search-bootstrap-binary "bash" + (%current-system)))) + (drv (derivation store "the-thing" bash + `("-e" ,build) + #:inputs `((,bash) (,build)) + #:env-vars `(("x" . ,(random-text)))))) + (exit (guard (c ((nix-protocol-error? c) + (->bool + (string-contains (pk (nix-protocol-error-message c)) + "failed")))) + (build-derivations store (list drv)) + #f))))' + + +for option in --max-silent-time=1 --timeout=1 +do + guix-daemon --listen="$socket" --disable-chroot "$option" & + daemon_pid=$! + + GUIX_DAEMON_SOCKET="$socket" guile -c "$client_code" + kill "$daemon_pid" +done |