From 52b56cc5f276aa22a0a923c2f880912fb272594c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 7 Oct 2014 17:17:17 +1800 Subject: [PATCH] [PATCH v2 11/12] test: Test upgrade to ghost messages feature --- 54/eacf0afc0b367892f7f552eca814933771a894 | 112 ++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 54/eacf0afc0b367892f7f552eca814933771a894 diff --git a/54/eacf0afc0b367892f7f552eca814933771a894 b/54/eacf0afc0b367892f7f552eca814933771a894 new file mode 100644 index 000000000..e7b5b46b9 --- /dev/null +++ b/54/eacf0afc0b367892f7f552eca814933771a894 @@ -0,0 +1,112 @@ +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 181DB431FB6 + for ; Mon, 6 Oct 2014 16:18:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 O8EZD2g24cdn for ; + Mon, 6 Oct 2014 16:18:02 -0700 (PDT) +Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu + [18.9.25.12]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 16EDC431FBC + for ; Mon, 6 Oct 2014 16:17:37 -0700 (PDT) +X-AuditID: 1209190c-f795e6d000006c66-2b-543323104e82 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP + id 59.75.27750.01323345; Mon, 6 Oct 2014 19:17:36 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s96NHPoT025205; + Mon, 6 Oct 2014 19:17:25 -0400 +Received: from drake.dyndns.org ([12.185.136.2]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s96NHMl4014475 + (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); + Mon, 6 Oct 2014 19:17:24 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.84) + (envelope-from ) + id 1XbHWs-0001Jz-Bo; Mon, 06 Oct 2014 17:17:22 -0600 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 11/12] test: Test upgrade to ghost messages feature +Date: Mon, 6 Oct 2014 17:17:17 -0600 +Message-Id: <1412637438-4821-12-git-send-email-aclements@csail.mit.edu> +X-Mailer: git-send-email 2.1.0 +In-Reply-To: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu> +References: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrHIsWRmVeSWpSXmKPExsUixG6noiugbBxisHSNgMWN1m5Gi+s3ZzI7 + MHk8W3WL2WPLoffMAUxRXDYpqTmZZalF+nYJXBmH/11iLzjGVdHd0crcwPieo4uRk0NCwERi + y4pFjBC2mMSFe+vZuhi5OIQEZjNJ7Fv/nxHC2cAo8XnyMShnKZPEhc8XWCCcJYwSk+a9YAHp + ZxPQl1ixdhIriC0iIC2x8+5sMJtZwEHi7aSnYDuEBdwk7szoB6tnEVCV+NS9hA3E5hVwlzjd + NZsN4g45iQ27/4PVcwLF11yZDDZHCKj3+c+nLBMY+RcwMqxilE3JrdLNTczMKU5N1i1OTszL + Sy3SNdTLzSzRS00p3cQICiZOSZ4djG8OKh1iFOBgVOLhjdhhGCLEmlhWXJl7iFGSg0lJlHcO + u3GIEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRFert9GIUK8KYmVValF+TApaQ4WJXHeTT/4QoQE + 0hNLUrNTUwtSi2CyMhwcShK8vxWBhgoWpaanVqRl5pQgpJk4OEGG8wAN/wdSw1tckJhbnJkO + kT/FqCglzhsMkhAASWSU5sH1wqL9FaM40CvCvOJKQFU8wEQB1/0KaDAT0GDTOfogg0sSEVJS + DYzpPrd2NYpMUS/Pn8bIuazcnDueJ1xrvks/05NP/fkWxb2CfY07W/K82abuZm/jdnt02aU0 + 48OvDeYF0V/qIncz3L8csfOPitCZ9+XivsvPvn8ba8Z6eT13xXfl+D9tZqFqrCfqi5ceUc1L + fLl79qul/9N/b1p1OXTBD6dmY+m3LcU2l803uSuxFGckGmoxFxUnAgCZRM7e0QIAAA== +Cc: Austin Clements +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: Mon, 06 Oct 2014 23:18:06 -0000 + +--- + test/T530-upgrade.sh | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh +index c4c4ac8..6b42a69 100755 +--- a/test/T530-upgrade.sh ++++ b/test/T530-upgrade.sh +@@ -116,4 +116,25 @@ MAIL_DIR/bar/new/21:2, + MAIL_DIR/bar/new/22:2, + MAIL_DIR/cur/51:2," + ++# Ghost messages are difficult to test since they're nearly invisible. ++# However, if the upgrade works correctly, the ghost message should ++# retain the right thread ID even if all of the original messages in ++# the thread are deleted. That's what we test. This won't detect if ++# the upgrade just plain didn't happen, but it should detect if ++# something went wrong. ++test_begin_subtest "ghost message retains thread ID" ++# Upgrade database ++notmuch new ++# Get thread ID of real message ++thread=$(notmuch search --output=threads id:4EFC743A.3060609@april.org) ++# Delete all real messages in that thread ++rm $(notmuch search --output=files $thread) ++notmuch new ++# "Deliver" ghost message ++add_message '[subject]=Ghost' '[id]=4EFC3931.6030007@april.org' ++# If the ghost upgrade worked, the new message should be attached to ++# the existing thread ID. ++nthread=$(notmuch search --output=threads id:4EFC3931.6030007@april.org) ++test_expect_equal "$thread" "$nthread" ++ + test_done +-- +2.1.0 + -- 2.26.2