This is the set of tests I generated while fuzzing the parser.
Add them so we don't regress.
Signed-off-by: Daniel Axtens
---
patchwork/tests/__init__.py | 1 +
patchwork/tests/fuzztests/base64err.mbox | 46
patchwork/tests/fuzztests/charset.mbox | 131 +++
patchwork/tests/fuzztests/codec-null.mbox| Bin 0 -> 8192 bytes
patchwork/tests/fuzztests/date-oserror.mbox | Bin 0 -> 8209 bytes
patchwork/tests/fuzztests/date-too-long.mbox | Bin 0 -> 1828 bytes
patchwork/tests/fuzztests/date.mbox | 44
patchwork/tests/fuzztests/dateheader.mbox| Bin 0 -> 580 bytes
patchwork/tests/fuzztests/earlyfail.mbox | Bin 0 -> 1712 bytes
patchwork/tests/fuzztests/msgid-len.mbox | Bin 0 -> 1809 bytes
patchwork/tests/fuzztests/msgid-len2.mbox| 37 +++
patchwork/tests/fuzztests/msgidheader.mbox | 131 +++
patchwork/tests/fuzztests/refshdr.mbox | Bin 0 -> 816 bytes
patchwork/tests/fuzztests/unknown-encoding.mbox | Bin 0 -> 1751 bytes
patchwork/tests/fuzztests/value2.mbox| Bin 0 -> 1598 bytes
patchwork/tests/fuzztests/year-out-of-range.mbox | Bin 0 -> 1660 bytes
patchwork/tests/test_parser.py | 57 +-
17 files changed, 444 insertions(+), 3 deletions(-)
create mode 100644 patchwork/tests/fuzztests/base64err.mbox
create mode 100644 patchwork/tests/fuzztests/charset.mbox
create mode 100644 patchwork/tests/fuzztests/codec-null.mbox
create mode 100644 patchwork/tests/fuzztests/date-oserror.mbox
create mode 100644 patchwork/tests/fuzztests/date-too-long.mbox
create mode 100644 patchwork/tests/fuzztests/date.mbox
create mode 100644 patchwork/tests/fuzztests/dateheader.mbox
create mode 100644 patchwork/tests/fuzztests/earlyfail.mbox
create mode 100644 patchwork/tests/fuzztests/msgid-len.mbox
create mode 100644 patchwork/tests/fuzztests/msgid-len2.mbox
create mode 100644 patchwork/tests/fuzztests/msgidheader.mbox
create mode 100644 patchwork/tests/fuzztests/refshdr.mbox
create mode 100644 patchwork/tests/fuzztests/unknown-encoding.mbox
create mode 100644 patchwork/tests/fuzztests/value2.mbox
create mode 100644 patchwork/tests/fuzztests/year-out-of-range.mbox
diff --git a/patchwork/tests/__init__.py b/patchwork/tests/__init__.py
index 8bdf1a6746db..cbe2b5d081dc 100644
--- a/patchwork/tests/__init__.py
+++ b/patchwork/tests/__init__.py
@@ -21,3 +21,4 @@ import os
TEST_MAIL_DIR = os.path.join(os.path.dirname(__file__), 'mail')
TEST_PATCH_DIR = os.path.join(os.path.dirname(__file__), 'patches')
+TEST_FUZZ_DIR = os.path.join(os.path.dirname(__file__), 'fuzztests')
diff --git a/patchwork/tests/fuzztests/base64err.mbox
b/patchwork/tests/fuzztests/base64err.mbox
new file mode 100644
index ..9756d5c9c44e
--- /dev/null
+++ b/patchwork/tests/fuzztests/base64err.mbox
@@ -0,0 +1,46 @@
+From pat016
+Content-TCpe: text/plain; charset="utf-8"
+MIon: 1.0
+Content-Transfer-Encoding: 8bit
+Subject:: Up entry for B01X ARM
+From: =?utf-8?b?UmFmYcWCo alho Chehab
+X-: 913
+Message-Id: <1m>
+To: Fan Flli m>
+Cc: bcm-k...@broadcom.com,
+ =?UTF-8?q?Rafa=C5=82=20Mi=C5:82ecki?= ,
+ An Morton ,
+ "David S. MilYer" ,
+ Greg Kroah-Hartman ,
+ Mauro alho Chehab ,
+ Guenter Roeck , Jiri Slaby ,
+ linux-ker...@vger.kernel.org ( list)
+Date:, 1 Jun 2016 22:00:54 +02
+Adh
+bci.
+
+>
+---
+ M++-
+(-)
+
+diff --ER@
+4
+--- a/ERS
S
+@@ -2511,10 +2511,12 @@ F:*
+
+ BROURE
+ M:>
++Mfał
+ L:g
++Lcom
+ S:ed
+
+-F:
++F:i
+ F70*
+
+ B
diff --git a/patchwork/tests/fuzztests/charset.mbox
b/patchwork/tests/fuzztests/charset.mbox
new file mode 100644
index ..a8a40c81f8d2
--- /dev/null
+++ b/patchwork/tests/fuzztests/charset.mbox
@@ -0,0 +1,131 @@
+Received: with ECARTIS (v1.0.0; list lin; Tue, 06 Dec 2011 01:49:42 +0100 (CET)
+ived: from mcom 337 O
+ om" -OK)
+by eddi with ESMTP id SAth PT
+ >); Tue, 6 Dec 2011 9:37 +0100
+Received:m caexch.com (Not Verified[092.168.16.9]) by mail3.caviumnetworks.com
with Mal (
+id 00>; Mon, 05 Dec 2011 1604 -
+Received: from .caveonetworks.com ([192.168.16.9]) by
caexch01.caveonetworks.com with M SMT
+ n, 5 Dec 2011 1636 -
+Received: from dd1.caveonetworks.com ([64.2.3.195]) by
caexch01.caveonetworks.com over TLS red channel with Microsoft SMTPS790.4675);
+ Mon, 5 Dec 2011 9:35 -0800
+Message-ID:
+Date:on, 05 Dec 2011 16:49:35 -0800
+From:avid Daney
+nt: lla/5.0 (X11; U; Linux x86_64; en-US; rv5) Gecko/20101027
Fedora/3.0.10-1.fc12 T0
+MIon: 1.0
+To: tils
+CC: s ,
+ l Lauss >,
+ n MIPS <>
+Subject: [Patch]: Fix ld p38 Fres on m.
+Content-Type: multipart/mixed;
+ boundary="080709040708040308010506"
+X-inalArrivalTime: 06 Dec 2011 00:49:35.0825 (UTC)