From fefb94713295d63d30a8bba257c41c3eb54e0998 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 19 Jun 2023 23:22:56 +0200 Subject: [PATCH] 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. --- tests/signing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/signing.sh b/tests/signing.sh index 9b673c609..f14b53e7f 100644 --- a/tests/signing.sh +++ b/tests/signing.sh @@ -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