diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/containers.scm | 3 | ||||
-rw-r--r-- | tests/derivations.scm | 8 | ||||
-rw-r--r-- | tests/guix-daemon.sh | 36 | ||||
-rw-r--r-- | tests/guix-package-net.sh | 2 |
4 files changed, 43 insertions, 6 deletions
diff --git a/tests/containers.scm b/tests/containers.scm index 0b3a4be12b..5323e5037d 100644 --- a/tests/containers.scm +++ b/tests/containers.scm @@ -194,11 +194,12 @@ %namespaces 1 (lambda () (sleep 100)))) + (expected (namespaces pid)) (result (container-excursion* pid (lambda () (namespaces 1))))) (kill pid SIGKILL) - (equal? result (namespaces pid)))))) + (equal? result expected))))) (skip-if-unsupported) (test-equal "container-excursion*, same namespaces" diff --git a/tests/derivations.scm b/tests/derivations.scm index cabbf7b951..f3aad1b906 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -831,10 +831,10 @@ (derivation-prerequisites-to-build store drv)) ((build* download*) (derivation-prerequisites-to-build store drv - #:substitutable? + #:substitutable-info (const #f)))) (and (null? build) - (equal? download (list output)) + (equal? (map substitutable-path download) (list output)) (null? download*) (null? build*)))))) @@ -879,7 +879,7 @@ ;; See <http://bugs.gnu.org/18747>. (and (null? build) (match download - (((? string? item)) + (((= substitutable-path item)) (string=? item (derivation->output-path drv)))))))))) (test-assert "derivation-prerequisites-to-build in 'check' mode" @@ -919,7 +919,7 @@ (set! query paths) '()) - (mock ((guix store) substitutable-paths + (mock ((guix store) substitutable-path-info record-substitutable-path-query) (let ((pred (substitution-oracle store (list drv)))) 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 diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index 1eff6abba3..927c856b23 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh @@ -49,7 +49,7 @@ profile="t-profile-$$" profile_alt="t-profile-alt-$$" rm -f "$profile" -trap 'rm -f "$profile" "$profile_alt" "$profile-"[0-9]* ; rm -rf t-home-'"$$" EXIT +trap 'rm -f "$profile" "$profile_alt" "$profile-"[0-9]* "$profile_alt-"[0-9]* ; rm -rf t-home-'"$$" EXIT guix package --bootstrap -p "$profile" -i guile-bootstrap |