From 010855afbbede0bf57fcf5aa71bad17facc82b73 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 2 Mar 2012 22:35:07 +2000 Subject: [PATCH] [PATCH 1/2] test: utility function to add a pre-generated message to the database. --- 15/5fb95695eb9465a49b8fcb3ca9531442e0e408 | 92 +++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 15/5fb95695eb9465a49b8fcb3ca9531442e0e408 diff --git a/15/5fb95695eb9465a49b8fcb3ca9531442e0e408 b/15/5fb95695eb9465a49b8fcb3ca9531442e0e408 new file mode 100644 index 000000000..f4726776c --- /dev/null +++ b/15/5fb95695eb9465a49b8fcb3ca9531442e0e408 @@ -0,0 +1,92 @@ +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 ABE86431FAE + for ; Thu, 1 Mar 2012 18:35:28 -0800 (PST) +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 gUu2nxbdLiIj for ; + Thu, 1 Mar 2012 18:35:28 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A3EDA431FD7 + for ; Thu, 1 Mar 2012 18:35:27 -0800 (PST) +Received: from fctnnbsc30w-142166230117.dhcp-dynamic.fibreop.nb.bellaliant.net + ([142.166.230.117] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) + (Exim 4.72) (envelope-from ) + id 1S3IL7-00085q-Ux; Thu, 01 Mar 2012 22:35:26 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.77) + (envelope-from ) + id 1S3IL2-0001ur-MX; Thu, 01 Mar 2012 22:35:20 -0400 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] test: utility function to add a pre-generated message to + the database. +Date: Thu, 1 Mar 2012 22:35:07 -0400 +Message-Id: <1330655708-7318-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.9 +In-Reply-To: <1330655708-7318-1-git-send-email-david@tethera.net> +References: <20120301215738.GA7466@mit.edu> + <1330655708-7318-1-git-send-email-david@tethera.net> +X-Spam_bar: - +Cc: David Bremner +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, 02 Mar 2012 02:35:28 -0000 + +From: David Bremner + +For various "nasty" messages, it is easier to ship a message rather +than try to generate a message which causes a failure. +--- + test/test-lib.sh | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +diff --git a/test/test-lib.sh b/test/test-lib.sh +index 2781506..17d0e48 100644 +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -376,6 +376,21 @@ ${template[body]} + EOF + } + ++# Add an existing message to the notmuch database. ++# ++# expects a message on stdin. ++# ++# uses the variable gen_msg_cnt from generate_message. ++ ++add_rfc822_message () ++{ ++ gen_msg_cnt=$((gen_msg_cnt + 1)) ++ gen_msg_name="msg-$(printf "%03d" $gen_msg_cnt)" ++ gen_msg_filename="${MAIL_DIR}/$gen_msg_name" ++ cat >$gen_msg_filename ++ notmuch new > /dev/null ++} ++ + # Generate a new message and add it to the database. + # + # All of the arguments and return values supported by generate_message +-- +1.7.9 + -- 2.26.2