The test JSON here is not correct, but the larger problem is thatit seems like no actual decryption is being done. --- test/T355-smime.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/T355-smime.sh b/test/T355-smime.sh index caedf5e..95dbf8f 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -99,4 +99,40 @@ Verification successful EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "Decryption and signature verification (notmuch CLI)" +test_subtest_known_broken +output=$(notmuch show --format=json --decrypt subject:"test encrypted message 001" \ + | notmuch_json_show_sanitize \ + | sed -e 's|"created": [1234567890]*|"created": 946728000|' \ + -e 's|"expires": [1234567890]*|"expires": 424242424|' ) +expected='[[[{"id": "XXXXX", + "match": true, + "excluded": false, + "filename": "YYYYY", + "timestamp": 946728000, + "date_relative": "2000-01-01", + "tags": ["inbox","signed"], + "headers": {"Subject": "test encrypted message 001", + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", + "To": "test_suite@notmuchmail.org", + "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, + "body": [{"id": 1, + "sigstatus": [{"status": "good", + "fingerprint": "'$FINGERPRINT'", + "expires": 424242424, + "created": 946728000}], + "content-type": "multipart/signed", + "content": [{"id": 2, + "content-type": "text/plain", + "content": "This is a test encrypted message.\n"}, + {"id": 3, + "content-length": 1930, + "content-transfer-encoding": "base64", + "content-type": "application/x-pkcs7-signature", + "filename": "smime.p7s"}]}]}, + []]]]' +test_expect_equal_json \ + "$output" \ + "$expected" + test_done -- 2.1.4