about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/binary-cache.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/binary-cache.sh b/tests/binary-cache.sh
index 09e25b29fdb6..48bc62d311de 100644
--- a/tests/binary-cache.sh
+++ b/tests/binary-cache.sh
@@ -125,13 +125,21 @@ nix-store -r $outPath --option binary-caches "file://$cacheDir" --option signed-
 # It should fail if we corrupt the .narinfo.
 clearStore
 
-for i in $cacheDir/*.narinfo; do
+cacheDir2=$TEST_ROOT/binary-cache-2
+rm -rf $cacheDir2
+cp -r $cacheDir $cacheDir2
+
+for i in $cacheDir2/*.narinfo; do
     grep -v References $i > $i.tmp
     mv $i.tmp $i
 done
 
 clearCacheCache
 
-(! nix-store -r $outPath --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' --option binary-cache-public-keys "$publicKey")
+(! nix-store -r $outPath --option binary-caches "file://$cacheDir2" --option signed-binary-caches '*' --option binary-cache-public-keys "$publicKey")
+
+# If we provide a bad and a good binary cache, it should succeed.
+
+nix-store -r $outPath --option binary-caches "file://$cacheDir2 file://$cacheDir" --option signed-binary-caches '*' --option binary-cache-public-keys "$publicKey"
 
 fi # HAVE_LIBSODIUM