From 2af101903b4ae5977ed83dc992a44d82b6912db3 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 2 Apr 2014 22:16:21 +2100 Subject: [PATCH] [Patch v5 6/6] test: verify tag backup generated by database upgrade --- 05/09b26d68f3c088382198de163ee0337bc105a4 | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 05/09b26d68f3c088382198de163ee0337bc105a4 diff --git a/05/09b26d68f3c088382198de163ee0337bc105a4 b/05/09b26d68f3c088382198de163ee0337bc105a4 new file mode 100644 index 000000000..4f7e5f9aa --- /dev/null +++ b/05/09b26d68f3c088382198de163ee0337bc105a4 @@ -0,0 +1,81 @@ +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 3FF54429E29 + for ; Tue, 1 Apr 2014 18:17:18 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 JZjARqXI-fLB for ; + Tue, 1 Apr 2014 18:17:16 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 17812431E64 + for ; Tue, 1 Apr 2014 18:16:51 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1WV9nO-00073S-OC; Tue, 01 Apr 2014 22:16:50 -0300 +Received: (nullmailer pid 18509 invoked by uid 1000); Wed, 02 Apr 2014 + 01:16:27 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v5 6/6] test: verify tag backup generated by database upgrade +Date: Tue, 1 Apr 2014 22:16:21 -0300 +Message-Id: <1396401381-18128-7-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.9.0 +In-Reply-To: <1396401381-18128-1-git-send-email-david@tethera.net> +References: <1396401381-18128-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: Wed, 02 Apr 2014 01:17:18 -0000 + +'pre upgrade dump' is not much of a test, but at least this way we get +somewhat sensible behaviour if it fails. +--- + test/T530-upgrade.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh +index d46e3d1..7a68ddf 100755 +--- a/test/T530-upgrade.sh ++++ b/test/T530-upgrade.sh +@@ -25,6 +25,8 @@ test_begin_subtest "path: search does not work with old database version" + output=$(notmuch search path:foo) + test_expect_equal "$output" "" + ++test_expect_success 'pre upgrade dump' 'notmuch dump | sort > pre-upgrade-dump' ++ + test_begin_subtest "database upgrade from format version 1" + output=$(notmuch new | sed -e 's/^Backing up tags to .*$/Backing up tags to FILENAME/') + test_expect_equal "$output" "\ +@@ -34,6 +36,10 @@ Backing up tags to FILENAME + Your notmuch database has now been upgraded to database format version 2. + No new mail." + ++test_begin_subtest "tag backup matches pre-upgrade dump" ++gunzip -c ${MAIL_DIR}/.notmuch/backup-*.gz | sort > backup-dump ++test_expect_equal_file pre-upgrade-dump backup-dump ++ + test_begin_subtest "folder: no longer matches in the middle of path" + output=$(notmuch search folder:baz) + test_expect_equal "$output" "" +-- +1.9.0 + -- 2.26.2