about summary refs log tree commit diff
path: root/tests/binary-cache.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-30T12·53+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-30T13·18+0200
commitbac123ddd9eaecb9044f7d7c9572f77825a18ad5 (patch)
tree51293a222a745d0cfa4dd00fe5d63956e9baf170 /tests/binary-cache.sh
parent3593c8285dec644f07156496fd8cd84ef70ec665 (diff)
Test the NAR info cache
Diffstat (limited to 'tests/binary-cache.sh')
-rw-r--r--tests/binary-cache.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/binary-cache.sh b/tests/binary-cache.sh
index b0b91905ad..09e25b29fd 100644
--- a/tests/binary-cache.sh
+++ b/tests/binary-cache.sh
@@ -12,7 +12,7 @@ nix-push --dest $cacheDir $outPath
 # By default, a binary cache doesn't support "nix-env -qas", but does
 # support installation.
 clearStore
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 
 export _NIX_CACHE_FILE_URLS=1
 
@@ -25,7 +25,7 @@ nix-store --option binary-caches "file://$cacheDir" -r $outPath
 
 # But with the right configuration, "nix-env -qas" should also work.
 clearStore
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 echo "WantMassQuery: 1" >> $cacheDir/nix-cache-info
 
 nix-env --option binary-caches "file://$cacheDir" -f dependencies.nix -qas \* | grep -- "--S"
@@ -55,8 +55,7 @@ mv $nar.good $nar
 
 # Test whether this unsigned cache is rejected if the user requires signed caches.
 clearStore
-
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 
 if nix-store --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' -r $outPath; then
     echo "unsigned binary cache incorrectly accepted"
@@ -107,16 +106,14 @@ nix-push --dest $cacheDir --key-file $TEST_ROOT/sk1 $outPath
 
 # Downloading should fail if we don't provide a key.
 clearStore
-
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 
 (! nix-store -r $outPath --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' )
 
 
 # And it should fail if we provide an incorrect key.
 clearStore
-
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 
 (! nix-store -r $outPath --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' --option binary-cache-public-keys "$badKey")
 
@@ -133,7 +130,7 @@ for i in $cacheDir/*.narinfo; do
     mv $i.tmp $i
 done
 
-rm -f $NIX_STATE_DIR/binary-cache*
+clearCacheCache
 
 (! nix-store -r $outPath --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' --option binary-cache-public-keys "$publicKey")