[Patch v7 6/6] test: verify tag backup generated by database upgrade
authorDavid Bremner <david@tethera.net>
Sat, 5 Apr 2014 15:43:56 +0000 (12:43 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:13 +0000 (10:01 -0800)
ad/172f75f0b36dec9b2a3fa5dbde0d1d829d0f3e [new file with mode: 0644]

diff --git a/ad/172f75f0b36dec9b2a3fa5dbde0d1d829d0f3e b/ad/172f75f0b36dec9b2a3fa5dbde0d1d829d0f3e
new file mode 100644 (file)
index 0000000..1620f01
--- /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 41E04431FBF\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Apr 2014 08:45:52 -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 un5yFz9PISPr for <notmuch@notmuchmail.org>;\r
+       Sat,  5 Apr 2014 08:45:47 -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 2509D431FC4\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Apr 2014 08:45:42 -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 1WWSmC-00082a-9d; Sat, 05 Apr 2014 15:45:00 +0000\r
+Received: (nullmailer pid 10922 invoked by uid 1000); Sat, 05 Apr 2014\r
+       15:43:59 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v7 6/6] test: verify tag backup generated by database upgrade\r
+Date: Sat,  5 Apr 2014 12:43:56 -0300\r
+Message-Id: <1396712636-10640-7-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <1396712636-10640-1-git-send-email-david@tethera.net>\r
+References: <1396712636-10640-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: Sat, 05 Apr 2014 15:45: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