[PATCH 2/2] test: add new test file for mime parsing.

David Bremner david at tethera.net
Thu Mar 1 18:35:08 PST 2012


From: David Bremner <bremner at debian.org>

For now, just tests one message currently causing notmuch to segfault.
---
 test/mime         |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 test/notmuch-test |    1 +
 2 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100755 test/mime

diff --git a/test/mime b/test/mime
new file mode 100755
index 0000000..5b2d77f
--- /dev/null
+++ b/test/mime
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+
+test_description="mime parsing"
+. test-lib.sh
+
+add_rfc822_message <<EOF
+From bob.smith at fbi.gov Wed Feb 09 10:06:54 2011
+Return-path: <bob.smith at fbi.gov>
+Envelope-to: bobafett at archangel.wmdcantina.org
+Delivery-date: Wed, 09 Feb 2011 10:06:54 -0400
+Received: from fiero.its.cantina.org ([131.202.1.10])
+	by archangel.wmdcantina.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+	(Exim 4.69)
+	(envelope-from <bob.smith at fbi.gov>)
+	id 1PnAh4-0000AX-DH
+	for bobafett at archangel.wmdcantina.org; Wed, 09 Feb 2011 10:06:54 -0400
+Received: from mx3.nbpei-ecn.ca (mx3.nbpei-ecn.ca [198.164.163.196])
+	by fiero.its.cantina.org (8.13.8/8.13.8) with ESMTP id p19E6lst014693
+	for <bobafett at cantina.org>; Wed, 9 Feb 2011 10:06:47 -0400
+Received: from mx3.nbpei-ecn.ca (localhost.localdomain [127.0.0.1])
+	by localhost (Postfix) with SMTP id EC0C04B8002
+	for <bobafett at cantina.org>; Wed,  9 Feb 2011 10:06:47 -0400 (AST)
+Received: from cibc.ca (mail4.cibc.ca [199.198.251.34])
+	by mx3.nbpei-ecn.ca (Postfix) with ESMTP id A80824B8003
+	for <bobafett at cantina.org>; Wed,  9 Feb 2011 10:06:47 -0400 (AST)
+From: "Smith, Bob" <Bob.Smith at fbi.gov>
+To: "'BOBAFETT at CANTINA.ORG'" <BOBAFETT at cantina.org>
+Disposition-Notification-To: "Smith, Bob" <Bob.Smith at fbi.gov>
+Return-Receipt-To: <Bob.Smith at FBI.GOV>
+Date: Wed, 9 Feb 2011 09:06:43 -0500
+Subject: 
+Thread-Index: AcvIYpRcEJX82QtpQSacs5hsY+i4SQ==
+Message-ID: <5BB75198A4300643A295D4678B10F0503BDDF7CEB1 at CBMCC-X7-MBX09.ad.fbi.gov>
+Accept-Language: en-US
+Content-Language: en-US
+X-MS-Has-Attach: 
+X-MS-TNEF-Correlator: 
+acceptlanguage: en-US
+Content-Type: multipart/alternative;
+	boundary="_000_5BB75198A4300643A295D4678B10F0503BDDF7CEB1CBMCCX7MBX09a_"
+MIME-Version: 1.0
+X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.2.9.135719
+X-PerlMx-Spam: Gauge=IIIIIIIII, Probability=9%, Report='
+ BLANK_SUBJECT 0.1, HTML_NO_HTTP 0.1, SUPERLONG_LINE 0.05, BODYTEXTH_SIZE_10000_LESS 0, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __C230066_P5 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __FRAUD_CONTACT_NUM 0, __HAS_HTML 0, __HAS_MSGID 0, __MIME_HTML 0, __MIME_VERSION 0, __PHISH_FROM 0, __PHISH_FROM1 0, __PHISH_FROM_C 0, __SANE_MSGID 0, __STOCK_PHRASE_8 0, __TAG_EXISTS_HTML 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0'
+X-Sender-Verified: bob.smith at fbi.gov
+
+--_000_5BB75198A4300643A295D4678B10F0503BDDF7CEB1CBMCCX7MBX09a_
+Content-Type: text/plain; charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+quoted printable stuff.
+
+
+--_000_5BB75198A4300643A295D4678B10F0503BDDF7CEB1CBMCCX7MBX09a_
+Content-Type: text/html; charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+<html>
+some other stuff
+</html>
+
+--_000_5BB75198A4300643A295D4678B10F0503BDDF7CEB1CBMCCX7MBX09a_--
+
+
+EOF
+test_expect_success 'output message as json' "notmuch show --format=json id:5BB75198A4300643A295D4678B10F0503BDDF7CEB1 at CBMCC-X7-MBX09.ad.fbi.gov > /dev/null"
+test_done
diff --git a/test/notmuch-test b/test/notmuch-test
index f03b594..b572f1c 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -56,6 +56,7 @@ TESTS="
   emacs-address-cleaning
   emacs-hello
   emacs-show
+  mime
 "
 TESTS=${NOTMUCH_TESTS:=$TESTS}
 
-- 
1.7.9



More information about the notmuch mailing list