From e1bf2b9c7e661eb42746c770fdd43049d1180b9e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 26 Aug 2014 13:26:02 +2000 Subject: [PATCH] [PATCH v4 04/11] test: Tests for future version and unknown feature handling --- 26/4451ce83e9a95880fc3cce6751d49401bea207 | 139 ++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 26/4451ce83e9a95880fc3cce6751d49401bea207 diff --git a/26/4451ce83e9a95880fc3cce6751d49401bea207 b/26/4451ce83e9a95880fc3cce6751d49401bea207 new file mode 100644 index 000000000..ae6d02a87 --- /dev/null +++ b/26/4451ce83e9a95880fc3cce6751d49401bea207 @@ -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 1438C431FD0 + for ; Mon, 25 Aug 2014 10:27:18 -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 doSLJBXba7Y5 for ; + Mon, 25 Aug 2014 10:27:12 -0700 (PDT) +Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu + [18.7.68.37]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8FA82431FD7 + for ; Mon, 25 Aug 2014 10:26:27 -0700 (PDT) +X-AuditID: 12074425-f79e46d000002583-6f-53fb71c13024 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP + id 3D.7E.09603.1C17BF35; Mon, 25 Aug 2014 13:26:25 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s7PHQEXZ014411; + Mon, 25 Aug 2014 13:26:14 -0400 +Received: from drake.dyndns.org (31-35-14.wireless.csail.mit.edu + [128.31.35.14]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s7PHQC9K029611 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 25 Aug 2014 13:26:13 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XLy1z-0003jS-V6; Mon, 25 Aug 2014 13:26:11 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v4 04/11] test: Tests for future version and unknown feature + handling +Date: Mon, 25 Aug 2014 13:26:02 -0400 +Message-Id: <1408987569-14146-5-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1408987569-14146-1-git-send-email-amdragon@mit.edu> +References: <1408987569-14146-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsUixG6nonuw8HewwfI3YhY3WrsZLZqmO1tc + vzmT2YHZ49b91+wez1bdYvbYcug9cwBzFJdNSmpOZllqkb5dAlfGmy9bWQquCVV0nU1pYLzJ + 38XIwSEhYCJx7HhIFyMnkCkmceHeejYQW0hgNpPEilnOXYxcQPZGRok3h7exQzjHmCSmfJjG + CuHMZZQ4+ucYM0gLm4CGxO9bi5lAbBEBaYmdd2ezgtjMAl4Syy70g9nCAqESkzuOgtWzCKhK + 9E36yQJi8wo4SKy7OokZ4gw5iYYbn8DO4BRwlJi+cDYTxEkOEt8vn2eewMi/gJFhFaNsSm6V + bm5iZk5xarJucXJiXl5qka6FXm5miV5qSukmRnBguajuYJxwSOkQowAHoxIP743438FCrIll + xZW5hxglOZiURHmn5QOF+JLyUyozEosz4otKc1KLDzFKcDArifA2g+R4UxIrq1KL8mFS0hws + SuK8b62tgoUE0hNLUrNTUwtSi2CyMhwcShK8uQVAjYJFqempFWmZOSUIaSYOTpDhPEDD40Fq + eIsLEnOLM9Mh8qcYdTkmbXzfyyTEkpeflyolzvsfpEgApCijNA9uDiwhvGIUB3pLmPcoSBUP + MJnATXoFtIQJaIlpz0+QJSWJCCmpBsa+Ep0fgl6Oa+NCOnoYjbjWiHloKmYvXbNs3c7oK7Pm + L2byqk0NfX7Sg+nnZRm3hq2Wc23vbtr4+eOkj46nGpOOubPaieTdjAq6di61/vouhtdBVZxf + H95RF7zWPqerTuK66DbOE1Fd5tP2XjfQey1Zd0G7coaX8Q6D1XXKi7dfybfST987JV2JpTgj + 0VCLuag4EQAxhIiy4wIAAA== +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: Mon, 25 Aug 2014 17:27:18 -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 + -- 2.26.2