[PATCH 07/14] test: Tests for future version and unknown feature handling
authorAustin Clements <amdragon@MIT.EDU>
Sun, 27 Jul 2014 03:52:46 +0000 (23:52 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:03:52 +0000 (10:03 -0800)
a2/52c039ab1021e406db971cc56a2fa01874e16b [new file with mode: 0644]

diff --git a/a2/52c039ab1021e406db971cc56a2fa01874e16b b/a2/52c039ab1021e406db971cc56a2fa01874e16b
new file mode 100644 (file)
index 0000000..0d93212
--- /dev/null
@@ -0,0 +1,141 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1B955431FC7\r
+       for <notmuch@notmuchmail.org>; Sat, 26 Jul 2014 20:53:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id lTGfhUWLz6V1 for <notmuch@notmuchmail.org>;\r
+       Sat, 26 Jul 2014 20:53:49 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu\r
+       [18.9.25.15])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B0329431FD9\r
+       for <notmuch@notmuchmail.org>; Sat, 26 Jul 2014 20:53:14 -0700 (PDT)\r
+X-AuditID: 1209190f-f79f86d0000061c8-fd-53d477aad257\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 0F.91.25032.AA774D35; Sat, 26 Jul 2014 23:53:14 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s6R3r2oc009548; \r
+       Sat, 26 Jul 2014 23:53:03 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6R3r0dS016400\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 26 Jul 2014 23:53:02 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1XBFW8-00051O-BU; Sat, 26 Jul 2014 23:53:00 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 07/14] test: Tests for future version and unknown feature\r
+       handling\r
+Date: Sat, 26 Jul 2014 23:52:46 -0400\r
+Message-Id: <1406433173-19169-8-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0\r
+In-Reply-To: <1406433173-19169-1-git-send-email-amdragon@mit.edu>\r
+References: <1406433173-19169-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrruq/EqwwbGLbBbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXxvXmGSwFx4Qqtp7Zy9zAuI+/i5GTQ0LAROLG7ktMELaYxIV7\r
+       69m6GLk4hARmM0ls3LmVGcLZyChx8MNOdgjnDpPElcMHWEFahATmMkqcahIBsdkENCS27V/O\r
+       CGKLCEhL7Lw7G6iGg4NZQE3iT5cKSFhYIEjifscrFhCbRUBVYuuvr8wgNq+Ag8TWVW+YIa6Q\r
+       k2i48YkNxOYUcJQ4/uwEG8gYIaCaW5cSJzDyL2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRr\r
+       opebWaKXmlK6iREUMpyS/DsYvx1UOsQowMGoxMObwXYlWIg1say4MvcQoyQHk5Io734zoBBf\r
+       Un5KZUZicUZ8UWlOavEhRgkOZiURXqFioBxvSmJlVWpRPkxKmoNFSZz3rbVVsJBAemJJanZq\r
+       akFqEUxWhoNDSYL3RhlQo2BRanpqRVpmTglCmomDE2Q4D9DwDaUgw4sLEnOLM9Mh8qcYdTk+\r
+       9J5pYxJiycvPS5US5/0FUiQAUpRRmgc3BxbrrxjFgd4S5mUFWccDTBNwk14BLWECWsLifxlk\r
+       SUkiQkqqgZHvwZcFds0lTRf9pq6c9CTpQvqZ8j6eG7vVfVzYuGa/dZU1sbmxqqPT5xaj40Ij\r
+       ve1PjxlsWuPCFfRCh8NggRZDrsPHbv48hcYlkZnnlwhdq1dZe6aq2TzPamrhFrulpece9T1T\r
+       zHto6vbwubN6tna0isnqiLkn52rtmZVdbJEnzVTUOVGZX4mlOCPRUIu5qDgRADEmHrPQAgAA\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 27 Jul 2014 03:53:56 -0000\r
+\r
+---\r
+ test/T530-upgrade.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 46 insertions(+)\r
+\r
+diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh\r
+index c4c4ac8..c88bbc7 100755\r
+--- a/test/T530-upgrade.sh\r
++++ b/test/T530-upgrade.sh\r
+@@ -3,6 +3,52 @@ test_description="database upgrade"\r
\r
+ . ./test-lib.sh\r
\r
++test_begin_subtest "future database versions abort open"\r
++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 ""\r
++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/')\r
++rm -rf ${MAIL_DIR}/.notmuch\r
++test_expect_equal "$output" "\\r
++Error: Notmuch database at FILENAME\r
++       has a newer database format version (9999) than supported by this\r
++       version of notmuch (3)."\r
++\r
++test_begin_subtest "unknown 'rw' feature aborts read/write open"\r
++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw'\r
++output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/')\r
++rm -rf ${MAIL_DIR}/.notmuch\r
++test_expect_equal "$output" "\\r
++Error: Notmuch database at FILENAME\r
++       requires features (test feature)\r
++       not supported by this version of notmuch."\r
++\r
++test_begin_subtest "unknown 'rw' feature aborts read-only open"\r
++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw'\r
++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/')\r
++rm -rf ${MAIL_DIR}/.notmuch\r
++test_expect_equal "$output" "\\r
++Error: Notmuch database at FILENAME\r
++       requires features (test feature)\r
++       not supported by this version of notmuch."\r
++\r
++test_begin_subtest "unknown 'w' feature aborts read/write open"\r
++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw'\r
++output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/')\r
++rm -rf ${MAIL_DIR}/.notmuch\r
++test_expect_equal "$output" "\\r
++Error: Notmuch database at FILENAME\r
++       requires features (test feature)\r
++       not supported by this version of notmuch."\r
++\r
++test_begin_subtest "unknown 'w' feature does not abort read-only open"\r
++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw'\r
++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/')\r
++rm -rf ${MAIL_DIR}/.notmuch\r
++test_expect_equal "$output" ""\r
++\r
++#\r
++# Database v1\r
++#\r
++\r
+ dbtarball=database-v1.tar.xz\r
\r
+ # XXX: Accomplish the same with test lib helpers\r
+-- \r
+2.0.0\r
+\r