X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT350-crypto.sh;h=73aa58dee8a8a758974edc0879e43307a4b5c7d8;hb=71eaa19350883b30bafe885ea083c2e3f1621e10;hp=401a22c9b1fa70d5735a027ca0cb34e74f429b4c;hpb=ee5df7d7db895a427aa1e4343b2c8f794a0b2d73;p=notmuch diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index 401a22c9..73aa58de 100755 --- a/test/T350-crypto.sh +++ b/test/T350-crypto.sh @@ -5,7 +5,7 @@ # - verification of signatures from expired/revoked keys test_description='PGP/MIME signature verification and decryption' -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 ################################################## @@ -223,7 +223,7 @@ output=$(notmuch search mimetype:multipart/encrypted and mimetype:application/pg test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message 001 (encrypted inbox)" test_begin_subtest "decryption, --format=text" -output=$(notmuch show --format=text --decrypt subject:"test encrypted message 001" \ +output=$(notmuch show --format=text --decrypt=true subject:"test encrypted message 001" \ | notmuch_show_sanitize_all \ | sed -e 's|"created": [1234567890]*|"created": 946728000|') expected=' message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX @@ -255,7 +255,7 @@ test_expect_equal \ "$expected" test_begin_subtest "decryption, --format=json" -output=$(notmuch show --format=json --decrypt subject:"test encrypted message 001" \ +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 001" \ | notmuch_json_show_sanitize \ | sed -e 's|"created": [1234567890]*|"created": 946728000|') expected='[[[{"id": "XXXXX", @@ -293,7 +293,7 @@ test_expect_equal_json \ "$expected" test_begin_subtest "decryption, --format=json, --part=4" -output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted message 001" \ +output=$(notmuch show --format=json --part=4 --decrypt=true subject:"test encrypted message 001" \ | notmuch_json_show_sanitize \ | sed -e 's|"created": [1234567890]*|"created": 946728000|') expected='{"id": 4, @@ -307,13 +307,13 @@ test_begin_subtest "decrypt attachment (--part=5 --format=raw)" notmuch show \ --format=raw \ --part=5 \ - --decrypt \ + --decrypt=true \ subject:"test encrypted message 001" >OUTPUT test_expect_equal_file TESTATTACHMENT OUTPUT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} -output=$(notmuch show --format=json --decrypt subject:"test encrypted message 001" \ +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 001" \ | notmuch_json_show_sanitize \ | sed -e 's|"created": [1234567890]*|"created": 946728000|') expected='[[[{"id": "XXXXX", @@ -351,7 +351,7 @@ test_expect_success \ test_begin_subtest "decryption + signature verification" test_subtest_broken_gmime_2 -output=$(notmuch show --format=json --decrypt subject:"test encrypted message 002" \ +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 002" \ | notmuch_json_show_sanitize \ | sed -e 's|"created": [1234567890]*|"created": 946728000|') expected='[[[{"id": "XXXXX", @@ -384,10 +384,11 @@ test_expect_equal_json \ "$expected" test_begin_subtest "reply to encrypted message" -output=$(notmuch reply --decrypt subject:"test encrypted message 002" \ +output=$(notmuch reply --decrypt=true subject:"test encrypted message 002" \ | notmuch_drop_mail_headers In-Reply-To References) expected='From: Notmuch Test Suite Subject: Re: test encrypted message 002 +To: test_suite@notmuchmail.org On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite wrote: > This is another test encrypted message.' @@ -401,10 +402,10 @@ test_emacs "(let ((message-hidden-headers '()) (notmuch-show \"subject:test.encrypted.message.002\") (notmuch-show-reply) (test-output))" -# the empty To: is probably a bug, but it's not to do with encryption -grep -v -e '^In-Reply-To:' -e '^References:' -e '^Fcc:' -e 'To:' < OUTPUT > OUTPUT.clean +grep -v -e '^In-Reply-To:' -e '^References:' -e '^Fcc:' < OUTPUT > OUTPUT.clean cat <EXPECTED From: Notmuch Test Suite +To: test_suite@notmuchmail.org Subject: Re: test encrypted message 002 --text follows this line-- <#secure method=pgpmime mode=signencrypt>