aboutsummaryrefslogtreecommitdiff
path: root/test/T350-crypto.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-01-19 21:23:30 -0400
committerDavid Bremner <david@tethera.net>2022-01-26 07:22:09 -0400
commit8179c3d1146b6b19c64200f0617c4a1ba7588569 (patch)
treec5560ce232d6df2ed6188057d80928f638e4df72 /test/T350-crypto.sh
parentb559240bb1cbc3d0b18589bd3e5aa996ac84382d (diff)
test/emacs: known broken test for matching fcc and sent message
Based on the method outlined by Daniel Kahn Gillmor in id:87k1zm225v.fsf@fifthhorseman.net. With a delay of 0.2 seconds the test becomes flaky on my machine. With a 1 second delay it fails consistently for more than 1600 iterations.
Diffstat (limited to 'test/T350-crypto.sh')
-rwxr-xr-xtest/T350-crypto.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh
index 8dbf8935..209b8a74 100755
--- a/test/T350-crypto.sh
+++ b/test/T350-crypto.sh
@@ -13,16 +13,30 @@ test_description='PGP/MIME signature verification and decryption'
test_require_emacs
add_gnupg_home
-test_begin_subtest "emacs delivery of signed message"
+test_begin_subtest "emacs delivery of signed message via fcc"
test_expect_success \
'emacs_fcc_message \
"test signed message 001" \
"This is a test signed message." \
"(mml-secure-message-sign)"'
+test_begin_subtest "emacs delivery of signed message via fcc and smtp"
+test_subtest_known_broken
+emacs_deliver_message \
+ 'signed message sent via SMTP' \
+ 'This is a test that messages are sent via SMTP' \
+ "(add-hook 'message-send-mail-hook (lambda () (sleep-for 1)))
+ (mml-secure-message-sign)"
+msg_file=$(notmuch search --output=files subject:signed-message-sent-via-SMTP)
+test_expect_equal_message_body sent_message "$msg_file"
+
test_begin_subtest "signed part content-type indexing"
-output=$(notmuch search mimetype:multipart/signed and mimetype:application/pgp-signature | notmuch_search_sanitize)
-test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test signed message 001 (inbox signed)"
+notmuch search mimetype:multipart/signed and mimetype:application/pgp-signature | notmuch_search_sanitize > OUTPUT
+cat <<EOF >EXPECTED
+thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; test signed message 001 (inbox signed)
+thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; signed message sent via SMTP (inbox signed)
+EOF
+test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "signature verification"
output=$(notmuch show --format=json --verify subject:"test signed message 001" \