Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / cd / 88652a64001469554cb6993265da3273567c3c
1 Return-Path: <m.walters@qmul.ac.uk>\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 165AA431FD0\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Dec 2013 03:39:28 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 fPsQKlLr7zb9 for <notmuch@notmuchmail.org>;\r
17         Sun, 22 Dec 2013 03:39:20 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id CDD24431FC3\r
22         for <notmuch@notmuchmail.org>; Sun, 22 Dec 2013 03:39:19 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1VuhNI-0002f1-Qv; Sun, 22 Dec 2013 11:39:15 +0000\r
27 Received: from 92.41.155.221.threembb.co.uk ([92.41.155.221] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1VuhNG-0005um-9a; Sun, 22 Dec 2013 11:39:12 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 1/2] test: add emacs_fcc_message that does not use\r
34         smtp-dummy\r
35 In-Reply-To: <1387070158-30547-2-git-send-email-david@tethera.net>\r
36 References: <1387070158-30547-1-git-send-email-david@tethera.net>\r
37         <1387070158-30547-2-git-send-email-david@tethera.net>\r
38 User-Agent: Notmuch/0.15.2+478~gcd335dc (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Sun, 22 Dec 2013 11:39:07 +0000\r
41 Message-ID: <87eh55i084.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 92.41.155.221\r
45 X-QM-Geographic: According to ripencc,\r
46         this message was delivered by a machine in Britain (UK) (GB).\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: 1b4d85c28d30a14b5e8af894535203c0 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: 0.0\r
50 X-SpamAssassin-SpamBar: /\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored 0.0 points. Summary of the scoring: \r
55         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
56         provider *      (markwalters1009[at]gmail.com)\r
57 X-QM-Scan-Virus: ClamAV says the message is clean\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sun, 22 Dec 2013 11:39:28 -0000\r
71 \r
72 \r
73 Hi\r
74 \r
75 > Most of the tests previously using emacs_deliver_message do not use\r
76 > the actual transmitted message, so we replace it with a simpler (and\r
77 > presumably more reliable function) that only saves (and indexes) an\r
78 > fcc copy of the message.\r
79 \r
80 I get a test failure with this patch, but I have a tentative fix. It may\r
81 be a mis-configuration in some other part of my setup. \r
82 \r
83 My computer has a hostname of e4300 (which perhaps should be a FQDN?)\r
84 Anyway when running with this patch I get an error for the crypto test\r
85 as\r
86 \r
87  FAIL   reply to encrypted message\r
88         --- crypto.13.expected  2013-12-22 11:32:24.117104674 +0000\r
89         +++ crypto.13.output    2013-12-22 11:32:24.117104674 +0000\r
90         @@ -1,5 +1,7 @@\r
91          From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
92          Subject: Re: test encrypted message 002\r
93         +       <871u15xgs8.fsf@e4300.i-did-not-set--mail-host-address--so-tickle-me>\r
94         +       <871u15xgs8.fsf@e4300.i-did-not-set--mail-host-address--so-tickle-me>\r
95          \r
96          On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
97          > This is another test encrypted message.\r
98 \r
99 If I add the line\r
100 \r
101 (mail-host-address \"example.com\"))\r
102 \r
103 inside the let in emacs_fcc_message below then it passes. All tests also\r
104 pass on current master.\r
105 \r
106 Best wishes\r
107 \r
108 Mark\r
109 \r
110 \r
111 \r
112 >  test/crypto      | 10 +++-------\r
113 >  test/emacs       |  4 ++--\r
114 >  test/json        |  2 +-\r
115 >  test/sexp        |  2 +-\r
116 >  test/test-lib.sh | 29 +++++++++++++++++++++++++++++\r
117 >  5 files changed, 36 insertions(+), 11 deletions(-)\r
118 >\r
119 > diff --git a/test/crypto b/test/crypto\r
120 > index 9e5ff4f..477b397 100755\r
121 > --- a/test/crypto\r
122 > +++ b/test/crypto\r
123 > @@ -28,12 +28,8 @@ add_gnupg_home\r
124 >  # get key fingerprint\r
125 >  FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep '^fpr:' | cut -d: -f10)\r
126 >  \r
127 > -# for some reason this is needed for emacs_deliver_message to work,\r
128 > -# although I can't figure out why\r
129 > -add_email_corpus\r
130 > -\r
131 >  test_expect_success 'emacs delivery of signed message' \\r
132 > -'emacs_deliver_message \\r
133 > +'emacs_fcc_message \\r
134 >      "test signed message 001" \\r
135 >      "This is a test signed message." \\r
136 >      "(mml-secure-message-sign)"'\r
137 > @@ -143,7 +139,7 @@ cat <<EOF >TESTATTACHMENT\r
138 >  This is a test file.\r
139 >  EOF\r
140 >  test_expect_success 'emacs delivery of encrypted message with attachment' \\r
141 > -'emacs_deliver_message \\r
142 > +'emacs_fcc_message \\r
143 >      "test encrypted message 001" \\r
144 >      "This is a test encrypted message.\n" \\r
145 >      "(mml-attach-file \"TESTATTACHMENT\") (mml-secure-message-encrypt)"'\r
146 > @@ -270,7 +266,7 @@ test_expect_equal_json \\r
147 >  mv "${GNUPGHOME}"{.bak,}\r
148 >  \r
149 >  test_expect_success 'emacs delivery of encrypted + signed message' \\r
150 > -'emacs_deliver_message \\r
151 > +'emacs_fcc_message \\r
152 >      "test encrypted message 002" \\r
153 >      "This is another test encrypted message.\n" \\r
154 >      "(mml-secure-message-sign-encrypt)"'\r
155 > diff --git a/test/emacs b/test/emacs\r
156 > index 1b1ebe3..863219d 100755\r
157 > --- a/test/emacs\r
158 > +++ b/test/emacs\r
159 > @@ -771,7 +771,7 @@ test_expect_equal_file OUTPUT EXPECTED\r
160 >  \r
161 >  test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts"\r
162 >  id='message-with-application/mpeg-attachment@notmuchmail.org'\r
163 > -emacs_deliver_message \\r
164 > +emacs_fcc_message \\r
165 >      'Message with application/mpeg attachment' \\r
166 >      '' \\r
167 >      "(message-goto-eoh)\r
168 > @@ -786,7 +786,7 @@ test_expect_equal $(notmuch_counter_value) 1\r
169 >  \r
170 >  test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts"\r
171 >  id='message-with-audio/mpeg-attachment@notmuchmail.org'\r
172 > -emacs_deliver_message \\r
173 > +emacs_fcc_message \\r
174 >      'Message with audio/mpeg attachment' \\r
175 >      '' \\r
176 >      "(message-goto-eoh)\r
177 > diff --git a/test/json b/test/json\r
178 > index e07a290..c1cf649 100755\r
179 > --- a/test/json\r
180 > +++ b/test/json\r
181 > @@ -38,7 +38,7 @@ test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true\r
182 >  test_begin_subtest "Show message: json, inline attachment filename"\r
183 >  subject='json-show-inline-attachment-filename'\r
184 >  id="json-show-inline-attachment-filename@notmuchmail.org"\r
185 > -emacs_deliver_message \\r
186 > +emacs_fcc_message \\r
187 >      "$subject" \\r
188 >      'This is a test message with inline attachment with a filename' \\r
189 >      "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")\r
190 > diff --git a/test/sexp b/test/sexp\r
191 > index be815e1..667e319 100755\r
192 > --- a/test/sexp\r
193 > +++ b/test/sexp\r
194 > @@ -29,7 +29,7 @@ test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :f\r
195 >  test_begin_subtest "Show message: sexp, inline attachment filename"\r
196 >  subject='sexp-show-inline-attachment-filename'\r
197 >  id="sexp-show-inline-attachment-filename@notmuchmail.org"\r
198 > -emacs_deliver_message \\r
199 > +emacs_fcc_message \\r
200 >      "$subject" \\r
201 >      'This is a test message with inline attachment with a filename' \\r
202 >      "(mml-attach-file \"$TEST_DIRECTORY/README\" nil nil \"inline\")\r
203 > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
204 > index 53cb947..66c0720 100644\r
205 > --- a/test/test-lib.sh\r
206 > +++ b/test/test-lib.sh\r
207 > @@ -470,6 +470,35 @@ emacs_deliver_message ()\r
208 >      notmuch new >/dev/null\r
209 >  }\r
210 >  \r
211 > +# Pretend to deliver a message with emacs. Really save it to a file\r
212 > +# and add it to the database\r
213 > +#\r
214 > +# Uses emacs to generate and deliver a message to the mail store.\r
215 > +# Accepts arbitrary extra emacs/elisp functions to modify the message\r
216 > +# before sending, which is useful to doing things like attaching files\r
217 > +# to the message and encrypting/signing.\r
218 > +emacs_fcc_message ()\r
219 > +{\r
220 > +    local subject="$1"\r
221 > +    local body="$2"\r
222 > +    shift 2\r
223 > +    # before we can send a message, we have to prepare the FCC maildir\r
224 > +    mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp}\r
225 > +\r
226 > +    test_emacs \\r
227 > +     "(let ((message-send-mail-function (lambda () t)))\r
228 > +        (notmuch-mua-mail)\r
229 > +        (message-goto-to)\r
230 > +        (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\")\r
231 > +        (message-goto-subject)\r
232 > +        (insert \"${subject}\")\r
233 > +        (message-goto-body)\r
234 > +        (insert \"${body}\")\r
235 > +        $@\r
236 > +        (message-send-and-exit))" || return 1\r
237 > +    notmuch new >/dev/null\r
238 > +}\r
239 > +\r
240 >  # Generate a corpus of email and add it to the database.\r
241 >  #\r
242 >  # This corpus is fixed, (it happens to be 50 messages from early in\r
243 > -- \r
244 > 1.8.4.3\r
245 >\r
246 > _______________________________________________\r
247 > notmuch mailing list\r
248 > notmuch@notmuchmail.org\r
249 > http://notmuchmail.org/mailman/listinfo/notmuch\r