X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=test%2FT355-smime.sh;h=84be515a4ba4a21eb2a2f16cbf1b37195ff786e9;hb=f7921e6e1cdbfc1d16488f5b08cf3c9e2bd36b1d;hp=336da917df46887bcb0c262870e9afb6307ed08c;hpb=4cb789aa090fb6ba3c7897584ecbcc0a547b2f81;p=notmuch diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 336da917..84be515a 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -3,19 +3,6 @@ test_description='S/MIME signature verification and decryption' . $(dirname "$0")/test-lib.sh || exit 1 -add_gpgsm_home () -{ - local fpr - [ -d ${GNUPGHOME} ] && return - _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; } - at_exit_function _gnupg_exit - mkdir -m 0700 "$GNUPGHOME" - gpgsm --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/test.crt >"$GNUPGHOME"/import.log 2>&1 - fpr=$(gpgsm --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p') - echo "$fpr S relax" >> $GNUPGHOME/trustlist.txt - test_debug "cat $GNUPGHOME/import.log" -} - test_require_external_prereq openssl test_require_external_prereq gpgsm @@ -94,4 +81,13 @@ Verification successful EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Decryption (notmuch CLI)" +test_subtest_known_broken +notmuch show --decrypt=true subject:"test encrypted message 001" |\ + grep "^This is a" > OUTPUT +cat < EXPECTED +This is a test encrypted message. +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done