Re: Hi all
[notmuch-archives.git] / 23 / 499e072bcb0b860813b1a27443eee9e07e159e
1 Return-Path: <pieter@praet.org>\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 E7D7A429E26\r
6         for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 8qGUDYSWfGjI for <notmuch@notmuchmail.org>;\r
16         Tue,  1 Nov 2011 12:50:17 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id E4826431FD0\r
21         for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:16 -0700 (PDT)\r
22 Received: by wyg8 with SMTP id 8so2012948wyg.26\r
23         for <notmuch@notmuchmail.org>; Tue, 01 Nov 2011 12:50:15 -0700 (PDT)\r
24 Received: by 10.227.205.76 with SMTP id fp12mr1418426wbb.17.1320177015541;\r
25         Tue, 01 Nov 2011 12:50:15 -0700 (PDT)\r
26 Received: from localhost ([109.131.187.47])\r
27         by mx.google.com with ESMTPS id eu16sm66827wbb.7.2011.11.01.12.50.14\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Tue, 01 Nov 2011 12:50:15 -0700 (PDT)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [PATCH 1/4] test: add 'GnuPG' prereq to dependent 'crypto' tests\r
33 Date: Tue,  1 Nov 2011 20:49:11 +0100\r
34 Message-Id: <1320176954-4897-2-git-send-email-pieter@praet.org>\r
35 X-Mailer: git-send-email 1.7.7.1\r
36 In-Reply-To: <1320176954-4897-1-git-send-email-pieter@praet.org>\r
37 References: <1320176954-4897-1-git-send-email-pieter@praet.org>\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Tue, 01 Nov 2011 19:50:19 -0000\r
51 \r
52 Adds a new test that checks for the presence of 'gpg',\r
53 and adds that test as a prereq to all subsequent tests\r
54 that rely on GnuPG.\r
55 \r
56 This causes tests with unmet dependencies to be skipped.\r
57 \r
58 ---\r
59  test/crypto |   33 +++++++++++++++++++--------------\r
60  1 files changed, 19 insertions(+), 14 deletions(-)\r
61 \r
62 diff --git a/test/crypto b/test/crypto\r
63 index 0af4aa8..3795926 100755\r
64 --- a/test/crypto\r
65 +++ b/test/crypto\r
66 @@ -7,6 +7,11 @@\r
67  test_description='PGP/MIME signature verification and decryption'\r
68  . ./test-lib.sh\r
69  \r
70 +# GnuPG is a prereq.\r
71 +test_expect_success "prereq: GnuPG is present" "which gpg" \\r
72 +    && test_set_prereq GPG\r
73 +\r
74 +\r
75  add_gnupg_home ()\r
76  {\r
77      local output\r
78 @@ -31,7 +36,7 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep\r
79  # although I can't figure out why\r
80  add_email_corpus\r
81  \r
82 -test_expect_success 'emacs delivery of signed message' \\r
83 +test_expect_success GPG 'emacs delivery of signed message' \\r
84  'emacs_deliver_message \\r
85      "test signed message 001" \\r
86      "This is a test signed message." \\r
87 @@ -64,7 +69,7 @@ expected='[[[{"id": "XXXXX",\r
88   {"id": 3,\r
89   "content-type": "application/pgp-signature"}]}]},\r
90   []]]]'\r
91 -test_expect_equal \\r
92 +test_expect_equal GPG \\r
93      "$output" \\r
94      "$expected"\r
95  \r
96 @@ -99,7 +104,7 @@ expected='[[[{"id": "XXXXX",\r
97   {"id": 3,\r
98   "content-type": "application/pgp-signature"}]}]},\r
99   []]]]'\r
100 -test_expect_equal \\r
101 +test_expect_equal GPG \\r
102      "$output" \\r
103      "$expected"\r
104  \r
105 @@ -132,7 +137,7 @@ expected='[[[{"id": "XXXXX",\r
106   {"id": 3,\r
107   "content-type": "application/pgp-signature"}]}]},\r
108   []]]]'\r
109 -test_expect_equal \\r
110 +test_expect_equal GPG \\r
111      "$output" \\r
112      "$expected"\r
113  mv "${GNUPGHOME}"{.bak,}\r
114 @@ -141,7 +146,7 @@ mv "${GNUPGHOME}"{.bak,}\r
115  cat <<EOF >TESTATTACHMENT\r
116  This is a test file.\r
117  EOF\r
118 -test_expect_success 'emacs delivery of encrypted message with attachment' \\r
119 +test_expect_success GPG 'emacs delivery of encrypted message with attachment' \\r
120  'emacs_deliver_message \\r
121      "test encrypted message 001" \\r
122      "This is a test encrypted message.\n" \\r
123 @@ -175,7 +180,7 @@ Non-text part: application/octet-stream\r
124  \f\r
125 part}\r
126  \f\r
127 body}\r
128  \f\r
129 message}'\r
130 -test_expect_equal \\r
131 +test_expect_equal GPG \\r
132      "$output" \\r
133      "$expected"\r
134  \r
135 @@ -210,7 +215,7 @@ expected='[[[{"id": "XXXXX",\r
136   "content-type": "application/octet-stream",\r
137   "filename": "TESTATTACHMENT"}]}]}]},\r
138   []]]]'\r
139 -test_expect_equal \\r
140 +test_expect_equal GPG \\r
141      "$output" \\r
142      "$expected"\r
143  \r
144 @@ -221,7 +226,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m\r
145  expected='{"id": 4,\r
146   "content-type": "text/plain",\r
147   "content": "This is a test encrypted message.\n"}'\r
148 -test_expect_equal \\r
149 +test_expect_equal GPG \\r
150      "$output" \\r
151      "$expected"\r
152  \r
153 @@ -231,7 +236,7 @@ notmuch show \\r
154      --part=5 \\r
155      --decrypt \\r
156      subject:"test encrypted message 001" >OUTPUT\r
157 -test_expect_equal_file OUTPUT TESTATTACHMENT\r
158 +test_expect_equal_file GPG OUTPUT TESTATTACHMENT\r
159  \r
160  test_begin_subtest "decryption failure with missing key"\r
161  mv "${GNUPGHOME}"{,.bak}\r
162 @@ -258,12 +263,12 @@ expected='[[[{"id": "XXXXX",\r
163   {"id": 3,\r
164   "content-type": "application/octet-stream"}]}]},\r
165   []]]]'\r
166 -test_expect_equal \\r
167 +test_expect_equal GPG \\r
168      "$output" \\r
169      "$expected"\r
170  mv "${GNUPGHOME}"{.bak,}\r
171  \r
172 -test_expect_success 'emacs delivery of encrypted + signed message' \\r
173 +test_expect_success GPG 'emacs delivery of encrypted + signed message' \\r
174  'emacs_deliver_message \\r
175      "test encrypted message 002" \\r
176      "This is another test encrypted message.\n" \\r
177 @@ -298,7 +303,7 @@ expected='[[[{"id": "XXXXX",\r
178   "content-type": "text/plain",\r
179   "content": "This is another test encrypted message.\n"}]}]},\r
180   []]]]'\r
181 -test_expect_equal \\r
182 +test_expect_equal GPG \\r
183      "$output" \\r
184      "$expected"\r
185  \r
186 @@ -310,7 +315,7 @@ Subject: Re: test encrypted message 002\r
187  \r
188  On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
189  > This is another test encrypted message.'\r
190 -test_expect_equal \\r
191 +test_expect_equal GPG \\r
192      "$output" \\r
193      "$expected"\r
194  \r
195 @@ -351,7 +356,7 @@ expected='[[[{"id": "XXXXX",\r
196   {"id": 3,\r
197   "content-type": "application/pgp-signature"}]}]},\r
198   []]]]'\r
199 -test_expect_equal \\r
200 +test_expect_equal GPG \\r
201      "$output" \\r
202      "$expected"\r
203  \r
204 -- \r
205 1.7.7.1\r
206 \r