aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-daemon.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-13 15:46:12 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-13 18:29:01 +0200
commit24f5aaaf24e009de7f7402f2d311a26cafbf4f4a (patch)
tree117c62b4767426211474aadfde6f5c10bf90221d /tests/guix-daemon.sh
parent895d1eda547708dd46074a2dd2f934de275fb102 (diff)
downloadguix-24f5aaaf24e009de7f7402f2d311a26cafbf4f4a.tar
guix-24f5aaaf24e009de7f7402f2d311a26cafbf4f4a.tar.gz
substitute: Honor "substitute-urls" option passed by "untrusted" clients.
* guix/scripts/substitute.scm (or*): New macro. (%cache-url): Honor "untrusted-substitute-urls". * guix/tests.scm (%test-substitute-urls): New variable. (open-connection-for-tests): Use it. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes", "derivation-prerequisites-to-build and substitutes, non-substitutable build", "derivation-prerequisites-to-build and substitutes, local build"): Pass it to 'set-build-options'. * tests/guix-daemon.sh: Likewise. * tests/store.scm ("substitute query, alternating URLs"): New test. ("substitute query", "substitute", "substitute + build-things with output path", "substitute, corrupt output hash", "substitute --fallback"): Pass #:substitute-urls to 'set-build-options'.
Diffstat (limited to 'tests/guix-daemon.sh')
-rw-r--r--tests/guix-daemon.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index 87f17def12..0de6f278e4 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2014 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -54,11 +54,12 @@ EOF
rm -f "$XDG_CACHE_HOME/guix/substitute/$hash_part"
# Make sure we see the substitute.
-guile -c '
+guile -c "
(use-modules (guix))
(define store (open-connection))
- (set-build-options store #:use-substitutes? #t)
- (exit (has-substitutes? store "'"$out"'"))'
+ (set-build-options store #:use-substitutes? #t
+ #:substitute-urls (list \"$GUIX_BINARY_SUBSTITUTE_URL\"))
+ (exit (has-substitutes? store \"$out\"))"
# Now, run guix-daemon --no-substitutes.
socket="$NIX_STATE_DIR/alternate-socket"
@@ -72,6 +73,7 @@ guile -c "
(define store (open-connection \"$socket\"))
;; This setting MUST NOT override the daemon's --no-substitutes.
- (set-build-options store #:use-substitutes? #t)
+ (set-build-options store #:use-substitutes? #t
+ #:substitute-urls (list \"$GUIX_BINARY_SUBSTITUTE_URL\"))
(exit (not (has-substitutes? store \"$out\")))"