tests/signing.sh: Check signature checking error message

We should check error messages, so that we know the command fails for
the right reason.
Alternatively, a mere typo can run the test undetected.
This commit is contained in:
Robert Hensing 2023-06-19 23:22:56 +02:00
parent 1db81f7107
commit fefb947132

View file

@ -84,7 +84,7 @@ info=$(nix path-info --store file://$cacheDir --json $outPath2)
# Copying to a diverted store should fail due to a lack of signatures by trusted keys.
chmod -R u+w $TEST_ROOT/store0 || true
rm -rf $TEST_ROOT/store0
(! nix copy --to $TEST_ROOT/store0 $outPath)
expectStderr 1 nix copy --to $TEST_ROOT/store0 $outPath | grepQuiet -E 'cannot add path .* because it lacks a signature by a trusted key'
# But succeed if we supply the public keys.
nix copy --to $TEST_ROOT/store0 $outPath --trusted-public-keys $pk1