Skip to content

Commit

Permalink
tests/signing.sh: Check signature checking error message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roberth committed Jun 30, 2023
1 parent 1db81f7 commit fefb947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/signing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fefb947

Please sign in to comment.