From 42ae8d95aa152b69a8e190772845922ed7681cf5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 May 2016 15:03:04 +0200 Subject: Test trying the next substitute after a bad signature --- tests/binary-cache.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/binary-cache.sh') 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 -- cgit v1.2.3