From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1B955431FC7 for ; Sat, 26 Jul 2014 20:53:56 -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 lTGfhUWLz6V1 for ; Sat, 26 Jul 2014 20:53:49 -0700 (PDT) Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B0329431FD9 for ; Sat, 26 Jul 2014 20:53:14 -0700 (PDT) X-AuditID: 1209190f-f79f86d0000061c8-fd-53d477aad257 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 0F.91.25032.AA774D35; Sat, 26 Jul 2014 23:53:14 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s6R3r2oc009548; Sat, 26 Jul 2014 23:53:03 -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 s6R3r0dS016400 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 26 Jul 2014 23:53:02 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1XBFW8-00051O-BU; Sat, 26 Jul 2014 23:53:00 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 07/14] test: Tests for future version and unknown feature handling Date: Sat, 26 Jul 2014 23:52:46 -0400 Message-Id: <1406433173-19169-8-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1406433173-19169-1-git-send-email-amdragon@mit.edu> References: <1406433173-19169-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrruq/EqwwbGLbBbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXxvXmGSwFx4Qqtp7Zy9zAuI+/i5GTQ0LAROLG7ktMELaYxIV7 69m6GLk4hARmM0ls3LmVGcLZyChx8MNOdgjnDpPElcMHWEFahATmMkqcahIBsdkENCS27V/O CGKLCEhL7Lw7G6iGg4NZQE3iT5cKSFhYIEjifscrFhCbRUBVYuuvr8wgNq+Ag8TWVW+YIa6Q k2i48YkNxOYUcJQ4/uwEG8gYIaCaW5cSJzDyL2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRr opebWaKXmlK6iREUMpyS/DsYvx1UOsQowMGoxMObwXYlWIg1say4MvcQoyQHk5Io734zoBBf Un5KZUZicUZ8UWlOavEhRgkOZiURXqFioBxvSmJlVWpRPkxKmoNFSZz3rbVVsJBAemJJanZq akFqEUxWhoNDSYL3RhlQo2BRanpqRVpmTglCmomDE2Q4D9DwDaUgw4sLEnOLM9Mh8qcYdTk+ 9J5pYxJiycvPS5US5/0FUiQAUpRRmgc3BxbrrxjFgd4S5mUFWccDTBNwk14BLWECWsLifxlk SUkiQkqqgZHvwZcFds0lTRf9pq6c9CTpQvqZ8j6eG7vVfVzYuGa/dZU1sbmxqqPT5xaj40Ij ve1PjxlsWuPCFfRCh8NggRZDrsPHbv48hcYlkZnnlwhdq1dZe6aq2TzPamrhFrulpece9T1T zHto6vbwubN6tna0isnqiLkn52rtmZVdbJEnzVTUOVGZX4mlOCPRUIu5qDgRADEmHrPQAgAA 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: Sun, 27 Jul 2014 03:53:56 -0000 --- test/T530-upgrade.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh index c4c4ac8..c88bbc7 100755 --- a/test/T530-upgrade.sh +++ b/test/T530-upgrade.sh @@ -3,6 +3,52 @@ test_description="database upgrade" . ./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" "" + +# +# Database v1 +# + dbtarball=database-v1.tar.xz # XXX: Accomplish the same with test lib helpers -- 2.0.0