aboutsummaryrefslogtreecommitdiff
path: root/tests/fetchClosure.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fetchClosure.sh')
-rw-r--r--tests/fetchClosure.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/fetchClosure.sh b/tests/fetchClosure.sh
index 44050c878..a207f647c 100644
--- a/tests/fetchClosure.sh
+++ b/tests/fetchClosure.sh
@@ -1,7 +1,6 @@
source common.sh
enableFeatures "fetch-closure"
-needLocalStore "'--no-require-sigs' can’t be used with the daemon"
clearStore
clearCacheCache
@@ -28,24 +27,28 @@ clearStore
[ ! -e $nonCaPath ]
[ -e $caPath ]
-# In impure mode, we can use non-CA paths.
-[[ $(nix eval --raw --no-require-sigs --impure --expr "
- builtins.fetchClosure {
- fromStore = \"file://$cacheDir\";
- fromPath = $nonCaPath;
- }
-") = $nonCaPath ]]
+if [[ "$NIX_REMOTE" != "daemon" ]]; then
+
+ # In impure mode, we can use non-CA paths.
+ [[ $(nix eval --raw --no-require-sigs --impure --expr "
+ builtins.fetchClosure {
+ fromStore = \"file://$cacheDir\";
+ fromPath = $nonCaPath;
+ }
+ ") = $nonCaPath ]]
+
+ [ -e $nonCaPath ]
-[ -e $nonCaPath ]
+fi
# 'toPath' set to empty string should fail but print the expected path.
-nix eval -v --json --expr "
+expectStderr 1 nix eval -v --json --expr "
builtins.fetchClosure {
fromStore = \"file://$cacheDir\";
fromPath = $nonCaPath;
toPath = \"\";
}
-" 2>&1 | grep "error: rewriting.*$nonCaPath.*yielded.*$caPath"
+" | grep "error: rewriting.*$nonCaPath.*yielded.*$caPath"
# If fromPath is CA, then toPath isn't needed.
nix copy --to file://$cacheDir $caPath