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 41E04431FBF for ; Sat, 5 Apr 2014 08:45:52 -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 un5yFz9PISPr for ; Sat, 5 Apr 2014 08:45:47 -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 2509D431FC4 for ; Sat, 5 Apr 2014 08:45:42 -0700 (PDT) Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim 4.72) (envelope-from ) id 1WWSmC-00082a-9d; Sat, 05 Apr 2014 15:45:00 +0000 Received: (nullmailer pid 10922 invoked by uid 1000); Sat, 05 Apr 2014 15:43:59 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [Patch v7 6/6] test: verify tag backup generated by database upgrade Date: Sat, 5 Apr 2014 12:43:56 -0300 Message-Id: <1396712636-10640-7-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396712636-10640-1-git-send-email-david@tethera.net> References: <1396712636-10640-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: Sat, 05 Apr 2014 15:45: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