--- /dev/null
+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 13BFC431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:10:43 -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 ojx--vYTDTHe for <notmuch@notmuchmail.org>;\r
+ Thu, 31 Jul 2014 19:10:36 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
+ [18.9.25.14])\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 1B32A431FC9\r
+ for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:10:15 -0700 (PDT)\r
+X-AuditID: 1209190e-f79946d000007db1-3f-53daf706a87f\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id A3.DF.32177.607FAD35; Thu, 31 Jul 2014 22:10:14 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s712AD1e014727; \r
+ Thu, 31 Jul 2014 22:10:13 -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 s712ABE6030259\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Thu, 31 Jul 2014 22:10:12 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1XD2II-00033i-0q; Thu, 31 Jul 2014 22:10:06 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 06/13] test: Tests for future version and unknown feature\r
+ handling\r
+Date: Thu, 31 Jul 2014 22:09:56 -0400\r
+Message-Id: <1406859003-11561-7-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0\r
+In-Reply-To: <1406859003-11561-1-git-send-email-amdragon@mit.edu>\r
+References: <1406859003-11561-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsUixCmqrMv2/VawwZzTphar5/JYXL85k9mB\r
+ yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgynjzZStLwTWhiq6zKQ2MN/m7GDk5JARMJHas\r
+ PccKYYtJXLi3nq2LkYtDSGA2k8TxG0uhnI2MEheftLNDOHeYJKadb2MEaRESmMsoMfO3GIjN\r
+ JqAhsW3/crC4iIC0xM67s8HGMgs4Snzev4gNxBYWCJWYtv8RmM0ioCrxY1I3WA2vgIPEwe43\r
+ jBBnyEk03PgEVsMJ1Pv/3wJWiF0OEq2ntzJPYORfwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1\r
+ SNdYLzezRC81pXQTIziMJPl2MH49qHSIUYCDUYmHd0b4rWAh1sSy4srcQ4ySHExKorw2H4FC\r
+ fEn5KZUZicUZ8UWlOanFhxglOJiVRHhffgDK8aYkVlalFuXDpKQ5WJTEed9aWwULCaQnlqRm\r
+ p6YWpBbBZGU4OJQkeM98BWoULEpNT61Iy8wpQUgzcXCCDOcBGi70DWR4cUFibnFmOkT+FKMu\r
+ x4feM21MQix5+XmpUuK8e0AGCYAUZZTmwc2Bxf8rRnGgt4R5H4JU8QBTB9ykV0BLmICWPL91\r
+ HWRJSSJCSqqBkWVWmWLLrPb9IqEq5qcuPOXTYfFMruAKM9PaXCpUH9U4PfGmHs8Jw86G1U8C\r
+ LKKaXW85Pav5/Uyj44WK0/Nftl8vPVmmfFDnrPFWpqVb/qoyrO+X9vBd9GzGoqcnEm6J2OUv\r
+ CZE4MJlR83eM+TvheFm5HwmTpTs62RK3+UxcHW/0ap+k3w4HJZbijERDLeai4kQAc+oXKtoC AAA=\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: Fri, 01 Aug 2014 02:10:43 -0000\r
+\r
+---\r
+ test/T550-db-features.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 48 insertions(+)\r
+ create mode 100755 test/T550-db-features.sh\r
+\r
+diff --git a/test/T550-db-features.sh b/test/T550-db-features.sh\r
+new file mode 100755\r
+index 0000000..5569768\r
+--- /dev/null\r
++++ b/test/T550-db-features.sh\r
+@@ -0,0 +1,48 @@\r
++#!/usr/bin/env bash\r
++test_description="database version and feature compatibility"\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
++test_done\r
+-- \r
+2.0.0\r
+\r