--- /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 B5AC5431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jul 2014 09:48:27 -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 NaenK+hBT7Jk for <notmuch@notmuchmail.org>;\r
+ Tue, 29 Jul 2014 09:48:21 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu\r
+ [18.7.68.35])\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 17971431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jul 2014 09:48:21 -0700 (PDT)\r
+X-AuditID: 12074423-f79bf6d000007580-1b-53d7d0539687\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-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id DB.C9.30080.350D7D35; Tue, 29 Jul 2014 12:48:19 -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 s6TGmIk8002610; \r
+ Tue, 29 Jul 2014 12:48:18 -0400\r
+Received: from drake.dyndns.org (31-33-71.wireless.csail.mit.edu\r
+ [128.31.33.71]) (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 s6TGmFJR030258\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Tue, 29 Jul 2014 12:48:17 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1XCAZS-0007Gt-Rq; Tue, 29 Jul 2014 12:48:14 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 07/14] test: Tests for future version and unknown feature\r
+ handling\r
+Date: Tue, 29 Jul 2014 12:48:05 -0400\r
+Message-Id: <1406652492-27803-8-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0\r
+In-Reply-To: <1406652492-27803-1-git-send-email-amdragon@mit.edu>\r
+References: <1406652492-27803-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixG6nrht84Xqwwb8NGhar5/JYXL85k9mB\r
+ yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgynjzZStLwTWhiq6zKQ2MN/m7GDk5JARMJO4/\r
+ vMsOYYtJXLi3nq2LkYtDSGA2k8SqrXuZIJyNjBJTup+xQDjHmCSm3VjCBNIiJDCXUWLWNnkQ\r
+ m01AQ2Lb/uWMILaIgLTEzruzWUFsZgFHic/7FwGN5eAQFgiVOHwuByTMIqAq8e/dRjYQm1fA\r
+ QeLGtAlsEFfISTTc+ARmcwK13rp3F2qVg8ShWZtZJjDyL2BkWMUom5JbpZubmJlTnJqsW5yc\r
+ mJeXWqRrppebWaKXmlK6iREcRC7KOxj/HFQ6xCjAwajEw7th7rVgIdbEsuLK3EOMkhxMSqK8\r
+ evuuBwvxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4eU7C5TjTUmsrEotyodJSXOwKInzvrW2ChYS\r
+ SE8sSc1OTS1ILYLJynBwKEnwGp0HahQsSk1PrUjLzClBSDNxcIIM5wEa3gxSw1tckJhbnJkO\r
+ kT/FqMvxofdMG5MQS15+XqqUOG/2OaAiAZCijNI8uDmw6H/FKA70ljBvG8goHmDigJv0CmgJ\r
+ E9ASVhewJSWJCCmpBsZFdr7rqqLup3YwfG5iE2r/+Sbyi9H6RPap5h1Bm9XFq9evsqjer8kv\r
+ N3lu3KZpPS7Tu//psgSEfQrcrbPszPevd0zzNzpvPXPE2lHr/gStnG367U9jHxyu5j/NMFHz\r
+ StgcuaWXXBy+7b//tUZmqdG7uL8ZC3xPTP6QJm6msPNi5K8Cp31z4pYpsRRnJBpqMRcVJwIA\r
+ V7dtPdkCAAA=\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: Tue, 29 Jul 2014 16:48:27 -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