X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT357-index-decryption.sh;h=6b8a826186eaa1d98293bfa765adb7ec4d2af3d7;hb=6c6b0f13ffc3988b0f31774b33b8215be02abaa9;hp=fcecb1d9f4b19f6c76cc7be8d6e61b8a636e5029;hpb=29648a137c5807135ab168917b4a51d5e19e51c2;p=notmuch diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index fcecb1d9..6b8a8261 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" +output=$(notmuch show --decrypt 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 without --decrypt" +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"