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 723B4431FCB for ; Thu, 9 Jan 2014 23:33:58 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 kStYf5CJOvI2 for ; Thu, 9 Jan 2014 23:32:08 -0800 (PST) Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 5235D431FC3 for ; Thu, 9 Jan 2014 23:32:08 -0800 (PST) Received: by mail-ee0-f48.google.com with SMTP id t10so27850eei.35 for ; Thu, 09 Jan 2014 23:32:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=An4TGZjqieWpkGHUmhKr7HBmewLaYXVs2hRSMJCSZhg=; b=iAUEJWK+6E+lRfWjhSmZFHY0zN1OIB/AQFv7PD93EvGZ5qY7kukmkRZhZ4oOrBw8ky 0NE7UNa8Q4h9HttzxuRPyfBxjr6rt1IZZ5QhhwbcRrm8hWX6hhVW06xypwAJBfiCLliP haAYfN+B+sBxmzmcOLWDoBupYtw+72y4ApX1bqWonVgVpRN1aGykDz2jc7SYuCeO3njX ZY3zvn6V9ZxOQsvw+m+P6CqyDrWhQ2xvhSM5pTXSPycVQKnuSkRPuVFFljfjWfiSdHzW byOdohYrSRwc/uJUy7DC4qp3avYavTcjaNkNuaAGj+/cdcgMAjSJ9TY/yCaqnclBdM2B MWGg== X-Gm-Message-State: ALoCoQnjRkxj1/t05ZSci99a4Zi+9wiDl+70UiEOkMkJIyLPyIhulBvLHXaSjgL3kjFW1d3X8UEV X-Received: by 10.14.113.199 with SMTP id a47mr5617114eeh.41.1389305949892; Thu, 09 Jan 2014 14:19:09 -0800 (PST) Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. [88.195.111.91]) by mx.google.com with ESMTPSA id 4sm9382887eed.14.2014.01.09.14.19.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 Jan 2014 14:19:09 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 5/5] test: add database upgrade test from format version 1 Date: Fri, 10 Jan 2014 00:18:36 +0200 Message-Id: <33ae92e21bfeea0e21ad818d011fa4f000aa837c.1389304779.git.jani@nikula.org> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: References: In-Reply-To: References: 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, 10 Jan 2014 07:33:59 -0000 --- test/notmuch-test | 1 + test/upgrade | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 test/upgrade diff --git a/test/notmuch-test b/test/notmuch-test index d6fdd3a..68c8ad9 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -69,6 +69,7 @@ TESTS=" parse-time-string search-date thread-replies + upgrade " TESTS=${NOTMUCH_TESTS:=$TESTS} diff --git a/test/upgrade b/test/upgrade new file mode 100755 index 0000000..edee35d --- /dev/null +++ b/test/upgrade @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +test_description="database upgrade" + +. ./test-lib.sh + +tar zxf $TEST_DIRECTORY/test-databases/database-v1.tar.gz -C ${MAIL_DIR} --strip-components=1 + +# XXX: Test new notmuch with old database in read-only mode + +test_begin_subtest "database upgrade from format version 1" +output=$(notmuch new) +test_expect_equal "$output" "\ +Welcome to a new version of notmuch! Your database will now be upgraded. +Your notmuch database has now been upgraded to database format version 2. +No new mail." + +# XXX: Add some meaningful tests on the upgraded database, testing the +# things that have been upgraded. For folder search, this means +# actually having folders in the corpus. + +test_begin_subtest "Top level folder" +output=$(notmuch search folder:'""' | notmuch_search_sanitize) +test_expect_equal "$output" "" + +test_done -- 1.8.5.2