From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CB1B46DE0F62 for ; Mon, 27 May 2019 14:35:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.254 X-Spam-Level: X-Spam-Status: No, score=-0.254 tagged_above=-999 required=5 tests=[AWL=-0.053, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ucJUq-Kywhq for ; Mon, 27 May 2019 14:35:52 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 1D64E6DE0C7A for ; Mon, 27 May 2019 14:35:52 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558992948; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=T1/QMyfvFcxx2Lt3CfVy2fOrXSSLkIAadYloS5PnGdk=; b=gwb5S7MmU53eXBCOjb2Pq2wAA9Q066xmOTKI7l6NFwdI1WFjnjh6hF1G JzDMEGg9zPJE50eVsQlhl/BkSKfaAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558992948; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=T1/QMyfvFcxx2Lt3CfVy2fOrXSSLkIAadYloS5PnGdk=; b=SSzSnc6i5QXwh4zukmWIYH8UntO+JiY1Dxq2goeG4PLl0lZJXHGGnbAJ fMQMlna6K1FG1rtOoSFcovtXA1vH0uWOZAE62m6cUV37gOuxv0CQtUCgzY eMIYkn1irXDbFjKGLUgFe3UO3XsIjsGqN8TFwJ5QWSGKUG62dR3HTzEGf0 EBGAEz2XYH0btVau73DFkQG0viMJkkB0bRGKIb9j2YnAQ0EtQWbqgxqABt d1sCY5YkC7bxYuxpciKdYkppmA/qwI+8WahEN3rVapTFvsYBlyMK1Nu19K lXgaByqVk07DXFX3IF56vH2DxDpRnVL0O5vMsF+E8B79GZAccN9TuA== Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 89D93F99D for ; Mon, 27 May 2019 17:35:48 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id D40C720312; Mon, 27 May 2019 17:35:44 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v3 14/17] test: ensure that protected headers appear in notmuch-emacs search as expected Date: Mon, 27 May 2019 17:35:44 -0400 Message-Id: <20190527213544.7539-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <87d0k3643o.fsf@caltech.edu.net> References: <87d0k3643o.fsf@caltech.edu.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 21:35:52 -0000 We initially test only notmuch-search; tests for other functionality come in different patchsets later. Signed-off-by: Daniel Kahn Gillmor --- test/T358-emacs-protected-headers.sh | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 test/T358-emacs-protected-headers.sh diff --git a/test/T358-emacs-protected-headers.sh b/test/T358-emacs-protected-headers.sh new file mode 100755 index 00000000..5e97918f --- /dev/null +++ b/test/T358-emacs-protected-headers.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +test_description="protected headers in emacs interface" +. $(dirname "$0")/test-lib.sh || exit 1 + +# testing protected headers with emacs +add_gnupg_home +add_email_corpus protected-headers + +test_begin_subtest "notmuch-search should show not unindexed protected subject header in emacs" +test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org") + (notmuch-test-wait) + (test-output)' +cat <EXPECTED + 2000-01-01 [1/1] test_suite@notmuchmail.org Subject Unavailable (encrypted inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +# protected headers should behave differently after re-indexing +test_begin_subtest 'defaulting to indexing cleartext' +test_expect_success 'notmuch config set index.decrypt true' +test_begin_subtest 'try reindexing protected header message' +test_expect_success 'notmuch reindex id:protected-header@crypto.notmuchmail.org' + +test_begin_subtest "notmuch-search should show indexed protected subject header in emacs" +test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org") + (notmuch-test-wait) + (test-output)' +cat <EXPECTED + 2000-01-01 [1/1] test_suite@notmuchmail.org This is a protected header (encrypted inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done -- 2.20.1