database error
[notmuch-archives.git] / e6 / 5958629612bd7f851a2d70baf153cec2e95719
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 7FD40421166\r
6         for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 06:34:52 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.1\r
10 X-Spam-Level: \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
13         autolearn=disabled\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 phxkASxHzcjV for <notmuch@notmuchmail.org>;\r
17         Wed, 16 Nov 2011 06:34:50 -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 D2AC3429E58\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 DDE316A002C;\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=UpbYv8MrjKGuZ+yuWOtfmJIxr/n5em/BQ38RznVn7IY=;\r
27         h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References;\r
28         b=R+ixtysqdBEKkeB5UIx6qwyCnfpk9eOMs1Y3WMxZKYwXeTcdmu1gllg0Zkct7gRsu\r
29         HMwx/lWLpvu63DhXBvOdTcplLNaiDtbDmUzLTZeZUGPXBlRXknNPvgCkPZzNM4tLaO\r
30         sizjbZj5/ufHyxr6p0+FbbjW9vtzVP4UtPX1Ie2s=\r
31 From: Thomas Jost <schnouki@schnouki.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 4/6] test: add 'Emacs' prereq to dependent 'crypto' tests\r
34 Date: Wed, 16 Nov 2011 15:33:53 +0100\r
35 Message-Id: <1321454035-22023-5-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
42 Precedence: list\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:53 -0000\r
53 \r
54 From: Pieter Praet <pieter@praet.org>\r
55 \r
56 Adds a new test that checks for the presence of 'emacs',\r
57 and adds that test as a prereq to all subsequent tests\r
58 that rely on Emacs.\r
59 \r
60 This causes tests with unmet dependencies to be skipped.\r
61 \r
62 Right now, all crypto tests do depend on Emacs, because it\r
63 is used to generate the signed/encrypted messages that are\r
64 needed by the tests.\r
65 \r
66 Signed-off-by: Pieter Praet <pieter@praet.org>\r
67 ---\r
68  test/crypto |   39 +++++++++++++++++++++++++--------------\r
69  1 files changed, 25 insertions(+), 14 deletions(-)\r
70 \r
71 diff --git a/test/crypto b/test/crypto\r
72 index eca59b6..085070b 100755\r
73 --- a/test/crypto\r
74 +++ b/test/crypto\r
75 @@ -7,9 +7,20 @@\r
76  test_description='PGP/MIME signature verification and decryption'\r
77  . ./test-lib.sh\r
78  \r
79 +# Emacs is a prereq.\r
80 +test_set_bin_prereq dtach "dtach" DTACH\r
81 +test_have_prereq DTACH && test_set_bin_prereq emacs "Emacs" EMACS\r
82 +\r
83  # GnuPG is a prereq.\r
84  test_set_bin_prereq gpg "GnuPG" GPG\r
85  \r
86 +# Some tests have multiple prereqs, but the test_expect_* functions\r
87 +# accept only a single argument as prereq tag, and using test_have_prereq\r
88 +# in and around tests causes various errors for me, so a dirty workaround\r
89 +# will have to do for the time being.\r
90 +test_have_prereq EMACS && test_have_prereq GPG \\r
91 +    && test_set_prereq EMACS+GPG\r
92 +\r
93  \r
94  add_gnupg_home ()\r
95  {\r
96 @@ -36,7 +47,7 @@ test_have_prereq GPG && FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-col\r
97  # although I can't figure out why\r
98  add_email_corpus\r
99  \r
100 -test_expect_success GPG 'emacs delivery of signed message' \\r
101 +test_expect_success EMACS+GPG 'emacs delivery of signed message' \\r
102  'emacs_deliver_message \\r
103      "test signed message 001" \\r
104      "This is a test signed message." \\r
105 @@ -69,7 +80,7 @@ expected='[[[{"id": "XXXXX",\r
106   {"id": 3,\r
107   "content-type": "application/pgp-signature"}]}]},\r
108   []]]]'\r
109 -test_expect_equal GPG \\r
110 +test_expect_equal EMACS+GPG \\r
111      "$output" \\r
112      "$expected"\r
113  \r
114 @@ -104,7 +115,7 @@ expected='[[[{"id": "XXXXX",\r
115   {"id": 3,\r
116   "content-type": "application/pgp-signature"}]}]},\r
117   []]]]'\r
118 -test_expect_equal GPG \\r
119 +test_expect_equal EMACS+GPG \\r
120      "$output" \\r
121      "$expected"\r
122  \r
123 @@ -137,7 +148,7 @@ expected='[[[{"id": "XXXXX",\r
124   {"id": 3,\r
125   "content-type": "application/pgp-signature"}]}]},\r
126   []]]]'\r
127 -test_expect_equal GPG \\r
128 +test_expect_equal EMACS+GPG \\r
129      "$output" \\r
130      "$expected"\r
131  mv "${GNUPGHOME}"{.bak,}\r
132 @@ -146,7 +157,7 @@ mv "${GNUPGHOME}"{.bak,}\r
133  cat <<EOF >TESTATTACHMENT\r
134  This is a test file.\r
135  EOF\r
136 -test_expect_success GPG 'emacs delivery of encrypted message with attachment' \\r
137 +test_expect_success EMACS+GPG 'emacs delivery of encrypted message with attachment' \\r
138  'emacs_deliver_message \\r
139      "test encrypted message 001" \\r
140      "This is a test encrypted message.\n" \\r
141 @@ -180,7 +191,7 @@ Non-text part: application/octet-stream\r
142  \f\r
143 part}\r
144  \f\r
145 body}\r
146  \f\r
147 message}'\r
148 -test_expect_equal GPG \\r
149 +test_expect_equal EMACS+GPG \\r
150      "$output" \\r
151      "$expected"\r
152  \r
153 @@ -215,7 +226,7 @@ expected='[[[{"id": "XXXXX",\r
154   "content-type": "application/octet-stream",\r
155   "filename": "TESTATTACHMENT"}]}]}]},\r
156   []]]]'\r
157 -test_expect_equal GPG \\r
158 +test_expect_equal EMACS+GPG \\r
159      "$output" \\r
160      "$expected"\r
161  \r
162 @@ -226,7 +237,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m\r
163  expected='{"id": 4,\r
164   "content-type": "text/plain",\r
165   "content": "This is a test encrypted message.\n"}'\r
166 -test_expect_equal GPG \\r
167 +test_expect_equal EMACS+GPG \\r
168      "$output" \\r
169      "$expected"\r
170  \r
171 @@ -236,7 +247,7 @@ notmuch show \\r
172      --part=5 \\r
173      --decrypt \\r
174      subject:"test encrypted message 001" >OUTPUT\r
175 -test_expect_equal_file GPG OUTPUT TESTATTACHMENT\r
176 +test_expect_equal_file EMACS+GPG OUTPUT TESTATTACHMENT\r
177  \r
178  test_begin_subtest "decryption failure with missing key"\r
179  mv "${GNUPGHOME}"{,.bak}\r
180 @@ -263,12 +274,12 @@ expected='[[[{"id": "XXXXX",\r
181   {"id": 3,\r
182   "content-type": "application/octet-stream"}]}]},\r
183   []]]]'\r
184 -test_expect_equal GPG \\r
185 +test_expect_equal EMACS+GPG \\r
186      "$output" \\r
187      "$expected"\r
188  mv "${GNUPGHOME}"{.bak,}\r
189  \r
190 -test_expect_success GPG 'emacs delivery of encrypted + signed message' \\r
191 +test_expect_success EMACS+GPG 'emacs delivery of encrypted + signed message' \\r
192  'emacs_deliver_message \\r
193      "test encrypted message 002" \\r
194      "This is another test encrypted message.\n" \\r
195 @@ -303,7 +314,7 @@ expected='[[[{"id": "XXXXX",\r
196   "content-type": "text/plain",\r
197   "content": "This is another test encrypted message.\n"}]}]},\r
198   []]]]'\r
199 -test_expect_equal GPG \\r
200 +test_expect_equal EMACS+GPG \\r
201      "$output" \\r
202      "$expected"\r
203  \r
204 @@ -315,7 +326,7 @@ Subject: Re: test encrypted message 002\r
205  \r
206  On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
207  > This is another test encrypted message.'\r
208 -test_expect_equal GPG \\r
209 +test_expect_equal EMACS+GPG \\r
210      "$output" \\r
211      "$expected"\r
212  \r
213 @@ -356,7 +367,7 @@ expected='[[[{"id": "XXXXX",\r
214   {"id": 3,\r
215   "content-type": "application/pgp-signature"}]}]},\r
216   []]]]'\r
217 -test_expect_equal GPG \\r
218 +test_expect_equal EMACS+GPG \\r
219      "$output" \\r
220      "$expected"\r
221  \r
222 -- \r
223 1.7.7.3\r
224 \r