From: David Bremner Date: Tue, 24 Mar 2015 13:24:04 +0000 (+2000) Subject: [Patch v5 1/8] test: Add two tests for error output from notmuch_database_open X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=46d2a978b50433cacf9a913af69d2cc0551d163b;p=notmuch-archives.git [Patch v5 1/8] test: Add two tests for error output from notmuch_database_open --- diff --git a/6d/839ac0a8c740958529095c748e1d2f9fd9ba6a b/6d/839ac0a8c740958529095c748e1d2f9fd9ba6a new file mode 100644 index 000000000..36370df2d --- /dev/null +++ b/6d/839ac0a8c740958529095c748e1d2f9fd9ba6a @@ -0,0 +1,93 @@ +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 096E8429E44 + for ; Tue, 24 Mar 2015 06:25:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=unavailable +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 XKNgZt5DMjWL for ; + Tue, 24 Mar 2015 06:25:53 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6FC5D429E45 + for ; Tue, 24 Mar 2015 06:25:42 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1YaOpI-0000sE-GP; Tue, 24 Mar 2015 13:25:00 +0000 +Received: (nullmailer pid 2676 invoked by uid 1000); Tue, 24 Mar 2015 + 13:24:25 -0000 +From: David Bremner +To: David Bremner , notmuch@notmuchmail.org +Subject: [Patch v5 1/8] test: Add two tests for error output from + notmuch_database_open +Date: Tue, 24 Mar 2015 09:24:04 -0400 +Message-Id: <1427203451-1540-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1427203451-1540-1-git-send-email-david@tethera.net> +References: <1426352554-4383-10-git-send-email-david@tethera.net> + <1427203451-1540-1-git-send-email-david@tethera.net> +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, 24 Mar 2015 13:25:55 -0000 + +This is arguably testing the same thing twice, but in the brave new +future where we don't use printf anymore, each subcommand will be +responsible for handling the output on it's own. +--- + test/T050-new.sh | 7 +++++++ + test/T150-tagging.sh | 6 ++++++ + 2 files changed, 13 insertions(+) + +diff --git a/test/T050-new.sh b/test/T050-new.sh +index 7119356..e6c3291 100755 +--- a/test/T050-new.sh ++++ b/test/T050-new.sh +@@ -276,4 +276,11 @@ test_expect_code 1 "Invalid tags set exit code" \ + + notmuch config set new.tags $OLDCONFIG + ++ ++test_begin_subtest "Xapian exception: read only files" ++chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB ++output=$(NOTMUCH_NEW 2>&1 | sed 's/: .*$//' ) ++chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB ++test_expect_equal "$output" "A Xapian exception occurred opening database" ++ + test_done +diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh +index 45471ac..4a2673d 100755 +--- a/test/T150-tagging.sh ++++ b/test/T150-tagging.sh +@@ -261,4 +261,10 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One' + + test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' + ++test_begin_subtest "Xapian exception: read only files" ++chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB ++output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) ++chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB ++test_expect_equal "$output" "A Xapian exception occurred opening database" ++ + test_done +-- +2.1.4 +