[Patch v6 6/6] test: verify tag backup generated by database upgrade
authorDavid Bremner <david@tethera.net>
Thu, 3 Apr 2014 19:41:23 +0000 (16:41 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:11 +0000 (10:01 -0800)
df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 [new file with mode: 0644]

diff --git a/df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176 b/df/c467d11de0a9361dae2cbc1dbdfb4ced8a6176
new file mode 100644 (file)
index 0000000..6be7209
--- /dev/null
@@ -0,0 +1,81 @@
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id CB4E7431FD2\r
+       for <notmuch@notmuchmail.org>; Thu,  3 Apr 2014 19:44:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id kRfpeCzHKx2Y for <notmuch@notmuchmail.org>;\r
+       Thu,  3 Apr 2014 19:44:50 -0700 (PDT)\r
+Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
+       [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id DE6E3431FCB\r
+       for <notmuch@notmuchmail.org>; Thu,  3 Apr 2014 19:44:48 -0700 (PDT)\r
+Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
+       4.72) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+       id 1WVtXo-00017O-79; Fri, 04 Apr 2014 02:07:48 +0000\r
+Received: (nullmailer pid 4022 invoked by uid 1000); Thu, 03 Apr 2014\r
+       19:41:39 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v6 6/6] test: verify tag backup generated by database upgrade\r
+Date: Thu,  3 Apr 2014 16:41:23 -0300\r
+Message-Id: <1396554083-3892-7-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <1396554083-3892-1-git-send-email-david@tethera.net>\r
+References: <1396554083-3892-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 04 Apr 2014 02:44:52 -0000\r
+\r
+'pre upgrade dump' is not much of a test, but at least this way we get\r
+somewhat sensible behaviour if it fails.\r
+---\r
+ test/T530-upgrade.sh | 6 ++++++\r
+ 1 file changed, 6 insertions(+)\r
+\r
+diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh\r
+index d46e3d1..7d5d5aa 100755\r
+--- a/test/T530-upgrade.sh\r
++++ b/test/T530-upgrade.sh\r
+@@ -25,6 +25,8 @@ test_begin_subtest "path: search does not work with old database version"\r
+ output=$(notmuch search path:foo)\r
+ test_expect_equal "$output" ""\r
\r
++test_expect_success 'pre upgrade dump' 'notmuch dump | sort > pre-upgrade-dump'\r
++\r
+ test_begin_subtest "database upgrade from format version 1"\r
+ output=$(notmuch new | sed -e 's/^Backing up tags to .*$/Backing up tags to FILENAME/')\r
+ test_expect_equal "$output" "\\r
+@@ -34,6 +36,10 @@ Backing up tags to FILENAME\r
+ Your notmuch database has now been upgraded to database format version 2.\r
+ No new mail."\r
\r
++test_begin_subtest "tag backup matches pre-upgrade dump"\r
++gunzip -c ${MAIL_DIR}/.notmuch/dump-*.gz | sort > backup-dump\r
++test_expect_equal_file pre-upgrade-dump backup-dump\r
++\r
+ test_begin_subtest "folder: no longer matches in the middle of path"\r
+ output=$(notmuch search folder:baz)\r
+ test_expect_equal "$output" ""\r
+-- \r
+1.9.0\r
+\r