Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 693C1429E32 for ; Fri, 13 May 2011 01:18:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DHVrT0OxEM8Z for ; Fri, 13 May 2011 01:18:00 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7AC2F431FD0 for ; Fri, 13 May 2011 01:18:00 -0700 (PDT) Received: by wwi36 with SMTP id 36so2086798wwi.2 for ; Fri, 13 May 2011 01:17:59 -0700 (PDT) Received: by 10.216.234.80 with SMTP id r58mr1044643weq.109.1305274679247; Fri, 13 May 2011 01:17:59 -0700 (PDT) Received: from localhost (54.209-242-81.adsl-dyn.isp.belgacom.be [81.242.209.54]) by mx.google.com with ESMTPS id o1sm1000886wej.32.2011.05.13.01.17.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 May 2011 01:17:58 -0700 (PDT) From: Pieter Praet To: Notmuch Mail Subject: [PATCH 2/4] test: add 'GPG' prereq to 'crypto' tests Date: Fri, 13 May 2011 10:17:14 +0200 Message-Id: <1305274636-19975-3-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305274636-19975-1-git-send-email-pieter@praet.org> References: <1305274636-19975-1-git-send-email-pieter@praet.org> Cc: Austin Clements X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 13 May 2011 08:18:01 -0000 Signed-off-by: Pieter Praet --- test/crypto | 30 ++++++++++++++++++------------ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/test/crypto b/test/crypto index 961d035..c2f381c 100755 --- a/test/crypto +++ b/test/crypto @@ -7,6 +7,12 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# GnuPG is a prereq. +if test_expect_success "prereq: GnuPG is present" "which gpg"; then + test_set_prereq GPG +fi + + add_gnupg_home () { local output @@ -31,7 +37,7 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep # although I can't figure out why add_email_corpus -test_expect_success 'emacs delivery of signed message' \ +test_expect_success GPG 'emacs delivery of signed message' \ 'emacs_deliver_message \ "test signed message 001" \ "This is a test signed message." \ @@ -66,7 +72,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/pgp-signature"}]} ]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -103,7 +109,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/pgp-signature"}]} ]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -139,7 +145,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/pgp-signature"}]} ]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} @@ -148,7 +154,7 @@ mv "${GNUPGHOME}"{.bak,} cat <TESTATTACHMENT This is a test file. EOF -test_expect_success 'emacs delivery of encrypted message with attachment' \ +test_expect_success GPG 'emacs delivery of encrypted message with attachment' \ 'emacs_deliver_message \ "test encrypted message 001" \ "This is a test encrypted message." \ @@ -186,7 +192,7 @@ expected='[[[{"id": "XXXXX", "filename": "TESTATTACHMENT"}]} ]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -195,7 +201,7 @@ notmuch show \ --format=part --part=4 \ --decrypt \ subject:"test encrypted message 001" >OUTPUT -test_expect_equal_file OUTPUT TESTATTACHMENT +test_expect_equal_file GPG OUTPUT TESTATTACHMENT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} @@ -224,12 +230,12 @@ expected='[[[{"id": "XXXXX", "content-type": "application/octet-stream"}]} ]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} -test_expect_success 'emacs delivery of encrypted/signed message' \ +test_expect_success GPG 'emacs delivery of encrypted/signed message' \ 'emacs_deliver_message \ "test encrypted message 002" \ "This is a test encrypted message." \ @@ -263,7 +269,7 @@ expected='[[[{"id": "XXXXX", "content-type": "text/plain", "content": "This is a test encrypted message.\n"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -275,7 +281,7 @@ Subject: Re: test encrypted message 002 On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite wrote: > This is a test encrypted message.' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -319,7 +325,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/pgp-signature"}]} ]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" -- 1.7.4.1