From: Austin Clements Date: Fri, 1 Aug 2014 02:09:56 +0000 (+2000) Subject: [PATCH v3 06/13] test: Tests for future version and unknown feature handling X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ccf9d6800095f0adaf3293019ab9e158552e2b3d;p=notmuch-archives.git [PATCH v3 06/13] test: Tests for future version and unknown feature handling --- diff --git a/a9/aa365d18553ec776e03755c3f22b4874ca9875 b/a9/aa365d18553ec776e03755c3f22b4874ca9875 new file mode 100644 index 000000000..74c679bb2 --- /dev/null +++ b/a9/aa365d18553ec776e03755c3f22b4874ca9875 @@ -0,0 +1,139 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 13BFC431FAE + for ; Thu, 31 Jul 2014 19:10:43 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ojx--vYTDTHe for ; + Thu, 31 Jul 2014 19:10:36 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu + [18.9.25.14]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1B32A431FC9 + for ; Thu, 31 Jul 2014 19:10:15 -0700 (PDT) +X-AuditID: 1209190e-f79946d000007db1-3f-53daf706a87f +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id A3.DF.32177.607FAD35; Thu, 31 Jul 2014 22:10:14 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s712AD1e014727; + Thu, 31 Jul 2014 22:10:13 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s712ABE6030259 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 31 Jul 2014 22:10:12 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XD2II-00033i-0q; Thu, 31 Jul 2014 22:10:06 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v3 06/13] test: Tests for future version and unknown feature + handling +Date: Thu, 31 Jul 2014 22:09:56 -0400 +Message-Id: <1406859003-11561-7-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1406859003-11561-1-git-send-email-amdragon@mit.edu> +References: <1406859003-11561-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsUixCmqrMv2/VawwZzTphar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgynjzZStLwTWhiq6zKQ2MN/m7GDk5JARMJHas + PccKYYtJXLi3nq2LkYtDSGA2k8TxG0uhnI2MEheftLNDOHeYJKadb2MEaRESmMsoMfO3GIjN + JqAhsW3/crC4iIC0xM67s8HGMgs4Snzev4gNxBYWCJWYtv8RmM0ioCrxY1I3WA2vgIPEwe43 + jBBnyEk03PgEVsMJ1Pv/3wJWiF0OEq2ntzJPYORfwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1 + SNdYLzezRC81pXQTIziMJPl2MH49qHSIUYCDUYmHd0b4rWAh1sSy4srcQ4ySHExKorw2H4FC + fEn5KZUZicUZ8UWlOanFhxglOJiVRHhffgDK8aYkVlalFuXDpKQ5WJTEed9aWwULCaQnlqRm + p6YWpBbBZGU4OJQkeM98BWoULEpNT61Iy8wpQUgzcXCCDOcBGi70DWR4cUFibnFmOkT+FKMu + x4feM21MQix5+XmpUuK8e0AGCYAUZZTmwc2Bxf8rRnGgt4R5H4JU8QBTB9ykV0BLmICWPL91 + HWRJSSJCSqqBkWVWmWLLrPb9IqEq5qcuPOXTYfFMruAKM9PaXCpUH9U4PfGmHs8Jw86G1U8C + LKKaXW85Pav5/Uyj44WK0/Nftl8vPVmmfFDnrPFWpqVb/qoyrO+X9vBd9GzGoqcnEm6J2OUv + CZE4MJlR83eM+TvheFm5HwmTpTs62RK3+UxcHW/0ap+k3w4HJZbijERDLeai4kQAc+oXKtoC AAA= +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 01 Aug 2014 02:10:43 -0000 + +--- + test/T550-db-features.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + create mode 100755 test/T550-db-features.sh + +diff --git a/test/T550-db-features.sh b/test/T550-db-features.sh +new file mode 100755 +index 0000000..5569768 +--- /dev/null ++++ b/test/T550-db-features.sh +@@ -0,0 +1,48 @@ ++#!/usr/bin/env bash ++test_description="database version and feature compatibility" ++ ++. ./test-lib.sh ++ ++test_begin_subtest "future database versions abort open" ++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 9999 "" ++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') ++rm -rf ${MAIL_DIR}/.notmuch ++test_expect_equal "$output" "\ ++Error: Notmuch database at FILENAME ++ has a newer database format version (9999) than supported by this ++ version of notmuch (3)." ++ ++test_begin_subtest "unknown 'rw' feature aborts read/write open" ++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw' ++output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') ++rm -rf ${MAIL_DIR}/.notmuch ++test_expect_equal "$output" "\ ++Error: Notmuch database at FILENAME ++ requires features (test feature) ++ not supported by this version of notmuch." ++ ++test_begin_subtest "unknown 'rw' feature aborts read-only open" ++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\trw' ++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') ++rm -rf ${MAIL_DIR}/.notmuch ++test_expect_equal "$output" "\ ++Error: Notmuch database at FILENAME ++ requires features (test feature) ++ not supported by this version of notmuch." ++ ++test_begin_subtest "unknown 'w' feature aborts read/write open" ++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw' ++output=$(notmuch new 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') ++rm -rf ${MAIL_DIR}/.notmuch ++test_expect_equal "$output" "\ ++Error: Notmuch database at FILENAME ++ requires features (test feature) ++ not supported by this version of notmuch." ++ ++test_begin_subtest "unknown 'w' feature does not abort read-only open" ++${TEST_DIRECTORY}/make-db-version ${MAIL_DIR} 3 $'test feature\tw' ++output=$(notmuch search x 2>&1 | sed 's/\(database at\) .*/\1 FILENAME/') ++rm -rf ${MAIL_DIR}/.notmuch ++test_expect_equal "$output" "" ++ ++test_done +-- +2.0.0 +