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 8931E429E21
\r
6 for <notmuch@notmuchmail.org>; Mon, 3 Oct 2011 09:48:47 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id Pu5jDpka+i0V for <notmuch@notmuchmail.org>;
\r
18 Mon, 3 Oct 2011 09:48:46 -0700 (PDT)
\r
19 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])
\r
20 by olra.theworths.org (Postfix) with ESMTP id 0C0FA431FB6
\r
21 for <notmuch@notmuchmail.org>; Mon, 3 Oct 2011 09:48:45 -0700 (PDT)
\r
22 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])
\r
23 by ks3536.kimsufi.com (Postfix) with ESMTPSA id 771716A06B0;
\r
24 Mon, 3 Oct 2011 18:48:43 +0200 (CEST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;
\r
26 s=key-schnouki; t=1317660523;
\r
27 bh=s6e7GW9RyH90CeutVGvgMB9KsaOj0xmeOa59RJ4cj4Q=;
\r
28 h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
\r
29 In-Reply-To:References;
\r
30 b=fILKdjt8ybqr2oAnXwVbmhceN4yoTGL5xhj5ZJvWtDtzeQ36CWDrewb2WhgS9KCeA
\r
31 6Kr6DPH0ro0QaHq4O4vA4mz4nr3ZkLxTzJxlySSFu33P2op6zniNjkBQJj1SPBISlj
\r
32 kUtIrMDq/VyLea/6fZa7lwqk4ICFA9yp6EG83DiA=
\r
33 From: Thomas Jost <schnouki@schnouki.net>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH 02/13] test: add 'GnuPG' prereq to dependent 'crypto' tests
\r
36 Date: Mon, 3 Oct 2011 18:47:16 +0200
\r
37 Message-Id: <1317660447-27520-3-git-send-email-schnouki@schnouki.net>
\r
38 X-Mailer: git-send-email 1.7.6.4
\r
39 In-Reply-To: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>
\r
40 References: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>
\r
41 In-Reply-To: <871uuuywtt.fsf@convex-new.cs.unb.ca>
\r
42 References: <871uuuywtt.fsf@convex-new.cs.unb.ca>
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Mon, 03 Oct 2011 16:48:47 -0000
\r
57 From: Pieter Praet <pieter@praet.org>
\r
59 Adds a new test that checks for the presence of 'gpg',
\r
60 and adds that test as a prereq to all subsequent tests
\r
63 This causes tests with unmet dependencies to be skipped.
\r
65 Signed-off-by: Pieter Praet <pieter@praet.org>
\r
67 test/crypto | 35 ++++++++++++++++++++---------------
\r
68 1 files changed, 20 insertions(+), 15 deletions(-)
\r
70 diff --git a/test/crypto b/test/crypto
\r
71 index b49a4e0..4ee318f 100755
\r
75 test_description='PGP/MIME signature verification and decryption'
\r
78 +# GnuPG is a prereq.
\r
79 +test_set_bin_prereq gpg "GnuPG" GPG
\r
85 [ -d ${GNUPGHOME} ] && return
\r
86 mkdir -m 0700 "$GNUPGHOME"
\r
87 + test_have_prereq GPG || return
\r
88 gpg --no-tty --import <$TEST_DIRECTORY/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1
\r
89 test_debug "cat $GNUPGHOME/import.log"
\r
90 if (gpg --quick-random --version >/dev/null 2>&1) ; then
\r
91 @@ -25,13 +30,13 @@ add_gnupg_home ()
\r
94 # get key fingerprint
\r
95 -FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10)
\r
96 +test_have_prereq GPG && FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10)
\r
98 # for some reason this is needed for emacs_deliver_message to work,
\r
99 # although I can't figure out why
\r
102 -test_expect_success 'emacs delivery of signed message' \
\r
103 +test_expect_success GPG 'emacs delivery of signed message' \
\r
104 'emacs_deliver_message \
\r
105 "test signed message 001" \
\r
106 "This is a test signed message." \
\r
107 @@ -64,7 +69,7 @@ expected='[[[{"id": "XXXXX",
\r
109 "content-type": "application/pgp-signature"}]}]},
\r
111 -test_expect_equal \
\r
112 +test_expect_equal GPG \
\r
116 @@ -99,7 +104,7 @@ expected='[[[{"id": "XXXXX",
\r
118 "content-type": "application/pgp-signature"}]}]},
\r
120 -test_expect_equal \
\r
121 +test_expect_equal GPG \
\r
125 @@ -132,7 +137,7 @@ expected='[[[{"id": "XXXXX",
\r
127 "content-type": "application/pgp-signature"}]}]},
\r
129 -test_expect_equal \
\r
130 +test_expect_equal GPG \
\r
133 mv "${GNUPGHOME}"{.bak,}
\r
134 @@ -141,7 +146,7 @@ mv "${GNUPGHOME}"{.bak,}
\r
135 cat <<EOF >TESTATTACHMENT
\r
136 This is a test file.
\r
138 -test_expect_success 'emacs delivery of encrypted message with attachment' \
\r
139 +test_expect_success GPG 'emacs delivery of encrypted message with attachment' \
\r
140 'emacs_deliver_message \
\r
141 "test encrypted message 001" \
\r
142 "This is a test encrypted message.\n" \
\r
143 @@ -175,7 +180,7 @@ Non-text part: application/octet-stream
\r
150 -test_expect_equal \
\r
151 +test_expect_equal GPG \
\r
155 @@ -210,7 +215,7 @@ expected='[[[{"id": "XXXXX",
\r
156 "content-type": "application/octet-stream",
\r
157 "filename": "TESTATTACHMENT"}]}]}]},
\r
159 -test_expect_equal \
\r
160 +test_expect_equal GPG \
\r
164 @@ -221,7 +226,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m
\r
165 expected='{"id": 4,
\r
166 "content-type": "text/plain",
\r
167 "content": "This is a test encrypted message.\n"}'
\r
168 -test_expect_equal \
\r
169 +test_expect_equal GPG \
\r
173 @@ -231,7 +236,7 @@ notmuch show \
\r
176 subject:"test encrypted message 001" >OUTPUT
\r
177 -test_expect_equal_file OUTPUT TESTATTACHMENT
\r
178 +test_expect_equal_file GPG OUTPUT TESTATTACHMENT
\r
180 test_begin_subtest "decryption failure with missing key"
\r
181 mv "${GNUPGHOME}"{,.bak}
\r
182 @@ -258,12 +263,12 @@ expected='[[[{"id": "XXXXX",
\r
184 "content-type": "application/octet-stream"}]}]},
\r
186 -test_expect_equal \
\r
187 +test_expect_equal GPG \
\r
190 mv "${GNUPGHOME}"{.bak,}
\r
192 -test_expect_success 'emacs delivery of encrypted + signed message' \
\r
193 +test_expect_success GPG 'emacs delivery of encrypted + signed message' \
\r
194 'emacs_deliver_message \
\r
195 "test encrypted message 002" \
\r
196 "This is another test encrypted message.\n" \
\r
197 @@ -298,7 +303,7 @@ expected='[[[{"id": "XXXXX",
\r
198 "content-type": "text/plain",
\r
199 "content": "This is another test encrypted message.\n"}]}]},
\r
201 -test_expect_equal \
\r
202 +test_expect_equal GPG \
\r
206 @@ -312,7 +317,7 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w
\r
207 Non-text part: multipart/encrypted
\r
208 Non-text part: application/pgp-encrypted
\r
209 > This is another test encrypted message.'
\r
210 -test_expect_equal \
\r
211 +test_expect_equal GPG \
\r
215 @@ -353,7 +358,7 @@ expected='[[[{"id": "XXXXX",
\r
217 "content-type": "application/pgp-signature"}]}]},
\r
219 -test_expect_equal \
\r
220 +test_expect_equal GPG \
\r