aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-30 15:03:04 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-30 15:18:12 +0200
commit42ae8d95aa152b69a8e190772845922ed7681cf5 (patch)
tree833ceb494022d51519b847cfeb160056edb12a03
parentbac123ddd9eaecb9044f7d7c9572f77825a18ad5 (diff)
Test trying the next substitute after a bad signature
-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 09e25b29f..48bc62d31 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