1 Return-Path: <schnouki@schnouki.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 8DD98421164
\r
6 for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 06:34:51 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id Ffu6-VdrDkom for <notmuch@notmuchmail.org>;
\r
17 Wed, 16 Nov 2011 06:34:49 -0800 (PST)
\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])
\r
19 by olra.theworths.org (Postfix) with ESMTP id 879DE429E54
\r
20 for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 06:34:25 -0800 (PST)
\r
21 Received: from thor.loria.fr (thor.loria.fr [152.81.12.250])
\r
22 by ks3536.kimsufi.com (Postfix) with ESMTPSA id AE8F76A002B;
\r
23 Wed, 16 Nov 2011 15:34:24 +0100 (CET)
\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;
\r
25 s=key-schnouki; t=1321454064;
\r
26 bh=K39A/M7BY/p0tE81ag8d2eNkX/jrnFGcLfSem4DjswM=;
\r
27 h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References;
\r
28 b=jYeXttxYUtRxAAdaTyxUhFYmThOunYdtqQUea/tXNBJ97jrgjWV8kf26n3be+a+tl
\r
29 ZIc9ZM+d45VN+6QIrhaI2U3HeZPPi4u3ZVZJW3Dfw88CR9SgIMqIwKBTBkEQQmlxLM
\r
30 dte+29I3STj0xaVBdqqm+KLR2sxvPr6/bgYf9UoY=
\r
31 From: Thomas Jost <schnouki@schnouki.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 3/6] test: add 'GnuPG' prereq to dependent 'crypto' tests
\r
34 Date: Wed, 16 Nov 2011 15:33:52 +0100
\r
35 Message-Id: <1321454035-22023-4-git-send-email-schnouki@schnouki.net>
\r
36 X-Mailer: git-send-email 1.7.7.3
\r
37 In-Reply-To: <1321454035-22023-1-git-send-email-schnouki@schnouki.net>
\r
38 References: <1320176954-4897-1-git-send-email-pieter@praet.org>
\r
39 <1321454035-22023-1-git-send-email-schnouki@schnouki.net>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Wed, 16 Nov 2011 14:34:52 -0000
\r
54 From: Pieter Praet <pieter@praet.org>
\r
56 Adds a new test that checks for the presence of 'gpg',
\r
57 and adds that test as a prereq to all subsequent tests
\r
60 This causes tests with unmet dependencies to be skipped.
\r
62 Signed-off-by: Pieter Praet <pieter@praet.org>
\r
64 test/crypto | 35 ++++++++++++++++++++---------------
\r
65 1 files changed, 20 insertions(+), 15 deletions(-)
\r
67 diff --git a/test/crypto b/test/crypto
\r
68 index 0af4aa8..eca59b6 100755
\r
72 test_description='PGP/MIME signature verification and decryption'
\r
75 +# GnuPG is a prereq.
\r
76 +test_set_bin_prereq gpg "GnuPG" GPG
\r
82 [ -d ${GNUPGHOME} ] && return
\r
83 mkdir -m 0700 "$GNUPGHOME"
\r
84 + test_have_prereq GPG || return
\r
85 gpg --no-tty --import <$TEST_DIRECTORY/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1
\r
86 test_debug "cat $GNUPGHOME/import.log"
\r
87 if (gpg --quick-random --version >/dev/null 2>&1) ; then
\r
88 @@ -25,13 +30,13 @@ add_gnupg_home ()
\r
91 # get key fingerprint
\r
92 -FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10)
\r
93 +test_have_prereq GPG && FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10)
\r
95 # for some reason this is needed for emacs_deliver_message to work,
\r
96 # although I can't figure out why
\r
99 -test_expect_success 'emacs delivery of signed message' \
\r
100 +test_expect_success GPG 'emacs delivery of signed message' \
\r
101 'emacs_deliver_message \
\r
102 "test signed message 001" \
\r
103 "This is a test signed message." \
\r
104 @@ -64,7 +69,7 @@ expected='[[[{"id": "XXXXX",
\r
106 "content-type": "application/pgp-signature"}]}]},
\r
108 -test_expect_equal \
\r
109 +test_expect_equal GPG \
\r
113 @@ -99,7 +104,7 @@ expected='[[[{"id": "XXXXX",
\r
115 "content-type": "application/pgp-signature"}]}]},
\r
117 -test_expect_equal \
\r
118 +test_expect_equal GPG \
\r
122 @@ -132,7 +137,7 @@ expected='[[[{"id": "XXXXX",
\r
124 "content-type": "application/pgp-signature"}]}]},
\r
126 -test_expect_equal \
\r
127 +test_expect_equal GPG \
\r
130 mv "${GNUPGHOME}"{.bak,}
\r
131 @@ -141,7 +146,7 @@ mv "${GNUPGHOME}"{.bak,}
\r
132 cat <<EOF >TESTATTACHMENT
\r
133 This is a test file.
\r
135 -test_expect_success 'emacs delivery of encrypted message with attachment' \
\r
136 +test_expect_success GPG 'emacs delivery of encrypted message with attachment' \
\r
137 'emacs_deliver_message \
\r
138 "test encrypted message 001" \
\r
139 "This is a test encrypted message.\n" \
\r
140 @@ -175,7 +180,7 @@ Non-text part: application/octet-stream
\r
147 -test_expect_equal \
\r
148 +test_expect_equal GPG \
\r
152 @@ -210,7 +215,7 @@ expected='[[[{"id": "XXXXX",
\r
153 "content-type": "application/octet-stream",
\r
154 "filename": "TESTATTACHMENT"}]}]}]},
\r
156 -test_expect_equal \
\r
157 +test_expect_equal GPG \
\r
161 @@ -221,7 +226,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m
\r
162 expected='{"id": 4,
\r
163 "content-type": "text/plain",
\r
164 "content": "This is a test encrypted message.\n"}'
\r
165 -test_expect_equal \
\r
166 +test_expect_equal GPG \
\r
170 @@ -231,7 +236,7 @@ notmuch show \
\r
173 subject:"test encrypted message 001" >OUTPUT
\r
174 -test_expect_equal_file OUTPUT TESTATTACHMENT
\r
175 +test_expect_equal_file GPG OUTPUT TESTATTACHMENT
\r
177 test_begin_subtest "decryption failure with missing key"
\r
178 mv "${GNUPGHOME}"{,.bak}
\r
179 @@ -258,12 +263,12 @@ expected='[[[{"id": "XXXXX",
\r
181 "content-type": "application/octet-stream"}]}]},
\r
183 -test_expect_equal \
\r
184 +test_expect_equal GPG \
\r
187 mv "${GNUPGHOME}"{.bak,}
\r
189 -test_expect_success 'emacs delivery of encrypted + signed message' \
\r
190 +test_expect_success GPG 'emacs delivery of encrypted + signed message' \
\r
191 'emacs_deliver_message \
\r
192 "test encrypted message 002" \
\r
193 "This is another test encrypted message.\n" \
\r
194 @@ -298,7 +303,7 @@ expected='[[[{"id": "XXXXX",
\r
195 "content-type": "text/plain",
\r
196 "content": "This is another test encrypted message.\n"}]}]},
\r
198 -test_expect_equal \
\r
199 +test_expect_equal GPG \
\r
203 @@ -310,7 +315,7 @@ Subject: Re: test encrypted message 002
\r
205 On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
\r
206 > This is another test encrypted message.'
\r
207 -test_expect_equal \
\r
208 +test_expect_equal GPG \
\r
212 @@ -351,7 +356,7 @@ expected='[[[{"id": "XXXXX",
\r
214 "content-type": "application/pgp-signature"}]}]},
\r
216 -test_expect_equal \
\r
217 +test_expect_equal GPG \
\r