From: Austin Clements Date: Tue, 29 Jul 2014 16:48:05 +0000 (+2000) Subject: [PATCH v2 07/14] test: Tests for future version and unknown feature handling X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ef85dc0e91066b8be09d87791a4986d2a50c71b;p=notmuch-archives.git [PATCH v2 07/14] test: Tests for future version and unknown feature handling --- diff --git a/0a/5bc8b22aa6aa9058f9fc85c7f996de95f826de b/0a/5bc8b22aa6aa9058f9fc85c7f996de95f826de new file mode 100644 index 000000000..df5c3f9ac --- /dev/null +++ b/0a/5bc8b22aa6aa9058f9fc85c7f996de95f826de @@ -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 B5AC5431FAE + for ; Tue, 29 Jul 2014 09:48:27 -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 NaenK+hBT7Jk for ; + Tue, 29 Jul 2014 09:48:21 -0700 (PDT) +Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu + [18.7.68.35]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 17971431FB6 + for ; Tue, 29 Jul 2014 09:48:21 -0700 (PDT) +X-AuditID: 12074423-f79bf6d000007580-1b-53d7d0539687 +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-6.mit.edu (Symantec Messaging Gateway) with SMTP + id DB.C9.30080.350D7D35; Tue, 29 Jul 2014 12:48:19 -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 s6TGmIk8002610; + Tue, 29 Jul 2014 12:48:18 -0400 +Received: from drake.dyndns.org (31-33-71.wireless.csail.mit.edu + [128.31.33.71]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6TGmFJR030258 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Tue, 29 Jul 2014 12:48:17 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XCAZS-0007Gt-Rq; Tue, 29 Jul 2014 12:48:14 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 07/14] test: Tests for future version and unknown feature + handling +Date: Tue, 29 Jul 2014 12:48:05 -0400 +Message-Id: <1406652492-27803-8-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1406652492-27803-1-git-send-email-amdragon@mit.edu> +References: <1406652492-27803-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixG6nrht84Xqwwb8NGhar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgynjzZStLwTWhiq6zKQ2MN/m7GDk5JARMJO4/ + vMsOYYtJXLi3nq2LkYtDSGA2k8SqrXuZIJyNjBJTup+xQDjHmCSm3VjCBNIiJDCXUWLWNnkQ + m01AQ2Lb/uWMILaIgLTEzruzWUFsZgFHic/7FwGN5eAQFgiVOHwuByTMIqAq8e/dRjYQm1fA + QeLGtAlsEFfISTTc+ARmcwK13rp3F2qVg8ShWZtZJjDyL2BkWMUom5JbpZubmJlTnJqsW5yc + mJeXWqRrppebWaKXmlK6iREcRC7KOxj/HFQ6xCjAwajEw7th7rVgIdbEsuLK3EOMkhxMSqK8 + evuuBwvxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4eU7C5TjTUmsrEotyodJSXOwKInzvrW2ChYS + SE8sSc1OTS1ILYLJynBwKEnwGp0HahQsSk1PrUjLzClBSDNxcIIM5wEa3gxSw1tckJhbnJkO + kT/FqMvxofdMG5MQS15+XqqUOG/2OaAiAZCijNI8uDmw6H/FKA70ljBvG8goHmDigJv0CmgJ + E9ASVhewJSWJCCmpBsZFdr7rqqLup3YwfG5iE2r/+Sbyi9H6RPap5h1Bm9XFq9evsqjer8kv + N3lu3KZpPS7Tu//psgSEfQrcrbPszPevd0zzNzpvPXPE2lHr/gStnG367U9jHxyu5j/NMFHz + StgcuaWXXBy+7b//tUZmqdG7uL8ZC3xPTP6QJm6msPNi5K8Cp31z4pYpsRRnJBpqMRcVJwIA + V7dtPdkCAAA= +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: Tue, 29 Jul 2014 16:48:27 -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 +