summaryrefslogtreecommitdiff
path: root/tests/guix-daemon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/guix-daemon.sh')
-rw-r--r--tests/guix-daemon.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index fde49e25a2f..9186ffd5858 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -145,3 +145,39 @@ guile -c '
145 (exit 145 (exit
146 (= 42 (pk (call-with-input-file (derivation->output-path drv) 146 (= 42 (pk (call-with-input-file (derivation->output-path drv)
147 read)))))))' 147 read)))))))'
148
149
150kill "$daemon_pid"
151
152# Make sure the daemon's default 'timeout' and 'max-silent-time' settings are
153# honored.
154
155client_code='
156 (use-modules (guix) (gnu packages) (guix tests) (srfi srfi-34))
157
158 (with-store store
159 (let* ((build (add-text-to-store store "build.sh"
160 "while true ; do : ; done"))
161 (bash (add-to-store store "bash" #t "sha256"
162 (search-bootstrap-binary "bash"
163 (%current-system))))
164 (drv (derivation store "the-thing" bash
165 `("-e" ,build)
166 #:inputs `((,bash) (,build))
167 #:env-vars `(("x" . ,(random-text))))))
168 (exit (guard (c ((nix-protocol-error? c)
169 (->bool
170 (string-contains (pk (nix-protocol-error-message c))
171 "failed"))))
172 (build-derivations store (list drv))
173 #f))))'
174
175
176for option in --max-silent-time=1 --timeout=1
177do
178 guix-daemon --listen="$socket" --disable-chroot "$option" &
179 daemon_pid=$!
180
181 GUIX_DAEMON_SOCKET="$socket" guile -c "$client_code"
182 kill "$daemon_pid"
183done