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 456A96DE00B4 for ; Tue, 1 May 2018 18:58:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 EpJSrEHG8Ml7 for ; Tue, 1 May 2018 18:58:19 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id E0B916DE00AC for ; Tue, 1 May 2018 18:58:18 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fDh29-0006H5-Mn; Tue, 01 May 2018 21:58:17 -0400 Received: (nullmailer pid 3458 invoked by uid 1000); Wed, 02 May 2018 01:58:16 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH v2 5/5] cli/show: enable --decrypt=stash In-Reply-To: <20180110001228.2211-6-dkg@fifthhorseman.net> References: <20180110001228.2211-1-dkg@fifthhorseman.net> <20180110001228.2211-6-dkg@fifthhorseman.net> Date: Tue, 01 May 2018 22:58:16 -0300 Message-ID: <87d0yeg6o7.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Wed, 02 May 2018 01:58:20 -0000 Daniel Kahn Gillmor writes: > + > + Note: ``--decrypt=stash`` requires a writable database. > + Otherwise, ``notmuch show`` operates entirely in read-only mode. I would rephrase this as "requires write access to the database"; otherwise it sounds like "writable" (or lack) is persistent property of databases. > +# show the message using stashing decryption > +test_begin_subtest "stash decryption during show" > +output=$(notmuch show --decrypt=stash tag:encrypted subject:002 | 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" > + This is a bit hard to follow. I think it would be better to isolate this kind of parsing in a function in test-lib.sh; then at least the name would suggest the intent. > +test_begin_subtest "search should now show the contents" I think the point is not that it _shows_ the contents, but that it finds them > +output=$(notmuch search wumpus) > +expected='thread:0000000000000003 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message for cleartext index 002 (encrypted inbox unread)' > +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then > + test_subtest_known_broken > +fi > +test_expect_equal \ > + "$output" \ > + "$expected"