X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT357-index-decryption.sh;h=2b8e05b839bcb934679c76098902fa3eb1ee75ea;hb=f2e6f76a046492650713c1c3f1f1a19f49de59ea;hp=fcecb1d9f4b19f6c76cc7be8d6e61b8a636e5029;hpb=29648a137c5807135ab168917b4a51d5e19e51c2;p=notmuch diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index fcecb1d9..2b8e05b8 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -188,6 +188,29 @@ test_expect_equal \ "$output" \ "$expected" +test_begin_subtest "index cleartext without keeping session keys" +test_expect_success "notmuch reindex --decrypt=nostash tag:blarney" + +test_begin_subtest "Ensure that the indexed terms are present" +output=$(notmuch search wumpus) +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "show one of the messages with --decrypt=true" +output=$(notmuch show --decrypt=true thread:0000000000000001 | awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: 3/{ f=1 }') +expected='This is a test encrypted message with a wumpus.' +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "Ensure that we cannot show the message with --decrypt=auto" +output=$(notmuch show thread:0000000000000001 | awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: 3/{ f=1 }') +expected='Non-text part: application/octet-stream' +test_expect_equal \ + "$output" \ + "$expected" + add_email_corpus crypto test_begin_subtest "indexing message fails when secret key not available"