From 4225e33cd4296435225cb8732056ca864ebb1bf0 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 4 Apr 2014 16:41:23 +2100 Subject: [PATCH] [Patch v6 6/6] test: verify tag backup generated by database upgrade --- df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 diff --git a/df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 b/df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 new file mode 100644 index 000000000..6be72091b --- /dev/null +++ b/df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 @@ -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 CB4E7431FD2 + for ; Thu, 3 Apr 2014 19:44:51 -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 kRfpeCzHKx2Y for ; + Thu, 3 Apr 2014 19:44:50 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id DE6E3431FCB + for ; Thu, 3 Apr 2014 19:44:48 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.72) (envelope-from ) + id 1WVtXo-00017O-79; Fri, 04 Apr 2014 02:07:48 +0000 +Received: (nullmailer pid 4022 invoked by uid 1000); Thu, 03 Apr 2014 + 19:41:39 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v6 6/6] test: verify tag backup generated by database upgrade +Date: Thu, 3 Apr 2014 16:41:23 -0300 +Message-Id: <1396554083-3892-7-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.9.0 +In-Reply-To: <1396554083-3892-1-git-send-email-david@tethera.net> +References: <1396554083-3892-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: Fri, 04 Apr 2014 02:44:52 -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..7d5d5aa 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/dump-*.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