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 182676DE1386 for ; Wed, 23 Nov 2016 08:41:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.054 X-Spam-Level: X-Spam-Status: No, score=-0.054 tagged_above=-999 required=5 tests=[AWL=-0.054] 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 CwWdtZlztlCX for ; Wed, 23 Nov 2016 08:41:19 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 26ADB6DE1385 for ; Wed, 23 Nov 2016 08:41:19 -0800 (PST) Received: from fifthhorseman.net (unknown [38.109.115.130]) by che.mayfirst.org (Postfix) with ESMTPSA id 2FAACF98C for ; Wed, 23 Nov 2016 11:41:15 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id B5FB62018F; Wed, 23 Nov 2016 11:41:12 -0500 (EST) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH] tests: account for varying-size OpenPGP signatures Date: Wed, 23 Nov 2016 11:41:12 -0500 Message-Id: <20161123164112.27847-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.10.2 In-Reply-To: <87eg23i052.fsf@alice.fifthhorseman.net> References: <87eg23i052.fsf@alice.fifthhorseman.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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, 23 Nov 2016 16:41:20 -0000 GnuPG 2.1.16 is now injecting the full issuer fingerprint in its signatures, which makes them about 32 octets larger when ascii-armored. This change in size means that the size of the MIME parts will vary depending on the version of gpg that the user has installed. at any rate, the signature part should be non-zero, so we just test for that instead of an exact size. --- test/T350-crypto.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index df2dc74..38f984f 100755 --- a/test/T350-crypto.sh +++ b/test/T350-crypto.sh @@ -37,7 +37,8 @@ test_expect_success 'emacs delivery of signed message' \ test_begin_subtest "signature verification" output=$(notmuch show --format=json --verify subject:"test signed message 001" \ | notmuch_json_show_sanitize \ - | sed -e 's|"created": [1234567890]*|"created": 946728000|') + | sed -e 's|"created": [1234567890]*|"created": 946728000|' \ + -e 's/"content-length": [1-9][0-9]*/"content-length": "NONZERO"/') expected='[[[{"id": "XXXXX", "match": true, "excluded": false, @@ -59,7 +60,7 @@ expected='[[[{"id": "XXXXX", "content": "This is a test signed message.\n"}, {"id": 3, "content-type": "application/pgp-signature", - "content-length": 280}]}]}, + "content-length": "NONZERO"}]}]}, []]]]' test_expect_equal_json \ "$output" \ @@ -71,7 +72,8 @@ echo "${FINGERPRINT}:6:" | gpg --no-tty --import-ownertrust >>"$GNUPGHOME"/trust gpg --no-tty --check-trustdb >>"$GNUPGHOME"/trust.log 2>&1 output=$(notmuch show --format=json --verify subject:"test signed message 001" \ | notmuch_json_show_sanitize \ - | sed -e 's|"created": [1234567890]*|"created": 946728000|') + | sed -e 's|"created": [1234567890]*|"created": 946728000|'\ + -e 's/"content-length": [1-9][0-9]*/"content-length": "NONZERO"/') expected='[[[{"id": "XXXXX", "match": true, "excluded": false, @@ -94,7 +96,7 @@ expected='[[[{"id": "XXXXX", "content": "This is a test signed message.\n"}, {"id": 3, "content-type": "application/pgp-signature", - "content-length": 280}]}]}, + "content-length": "NONZERO"}]}]}, []]]]' test_expect_equal_json \ "$output" \ @@ -105,7 +107,8 @@ test_begin_subtest "signature verification with signer key unavailable" mv "${GNUPGHOME}"{,.bak} output=$(notmuch show --format=json --verify subject:"test signed message 001" \ | notmuch_json_show_sanitize \ - | sed -e 's|"created": [1234567890]*|"created": 946728000|') + | sed -e 's|"created": [1234567890]*|"created": 946728000|' \ + -e 's/"content-length": [1-9][0-9]*/"content-length": "NONZERO"/') expected='[[[{"id": "XXXXX", "match": true, "excluded": false, @@ -127,7 +130,7 @@ expected='[[[{"id": "XXXXX", "content": "This is a test signed message.\n"}, {"id": 3, "content-type": "application/pgp-signature", - "content-length": 280}]}]}, + "content-length": "NONZERO"}]}]}, []]]]' test_expect_equal_json \ "$output" \ @@ -348,7 +351,8 @@ y | gpg --no-tty --quiet --import output=$(notmuch show --format=json --verify subject:"test signed message 001" \ | notmuch_json_show_sanitize \ - | sed -e 's|"created": [1234567890]*|"created": 946728000|') + | sed -e 's|"created": [1234567890]*|"created": 946728000|' \ + -e 's/"content-length": [1-9][0-9]*/"content-length": "NONZERO"/') expected='[[[{"id": "XXXXX", "match": true, "excluded": false, @@ -370,7 +374,7 @@ expected='[[[{"id": "XXXXX", "content": "This is a test signed message.\n"}, {"id": 3, "content-type": "application/pgp-signature", - "content-length": 280}]}]}, + "content-length": "NONZERO"}]}]}, []]]]' test_expect_equal_json \ "$output" \ -- 2.10.2