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 B9AAE429E28 for ; Thu, 2 Jun 2011 05:04:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 2U6ltwdbsbpD for ; Thu, 2 Jun 2011 05:04:18 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C6A53429E27 for ; Thu, 2 Jun 2011 05:04:17 -0700 (PDT) Received: by wyi11 with SMTP id 11so603864wyi.26 for ; Thu, 02 Jun 2011 05:04:16 -0700 (PDT) Received: by 10.227.43.9 with SMTP id u9mr650476wbe.74.1307016256189; Thu, 02 Jun 2011 05:04:16 -0700 (PDT) Received: from localhost ([109.131.21.86]) by mx.google.com with ESMTPS id ge4sm347758wbb.64.2011.06.02.05.04.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2011 05:04:14 -0700 (PDT) From: Pieter Praet To: Notmuch Mail Subject: [PATCH 1/4] test: add 'GnuPG' prereq to dependent 'crypto' tests Date: Thu, 2 Jun 2011 14:03:37 +0200 Message-Id: <1307016220-17509-2-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307016220-17509-1-git-send-email-pieter@praet.org> References: <1307016220-17509-1-git-send-email-pieter@praet.org> 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: Thu, 02 Jun 2011 12:04:18 -0000 Adds a new test that checks for the presence of 'gpg', and adds that test as a prereq to all subsequent tests that rely on GnuPG. This causes tests with unmet dependencies to be skipped. Signed-off-by: Pieter Praet --- test/crypto | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/test/crypto b/test/crypto index 8e92016..59f7989 100755 --- a/test/crypto +++ b/test/crypto @@ -7,6 +7,11 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# GnuPG is a prereq. +test_expect_success "prereq: GnuPG is present" "which gpg" \ + && test_set_prereq GPG + + add_gnupg_home () { local output @@ -31,7 +36,7 @@ FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-colons --fingerprint | grep # although I can't figure out why add_email_corpus -test_expect_success 'emacs delivery of signed message' \ +test_expect_success GPG 'emacs delivery of signed message' \ 'emacs_deliver_message \ "test signed message 001" \ "This is a test signed message." \ @@ -64,7 +69,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -99,7 +104,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -132,7 +137,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} @@ -141,7 +146,7 @@ mv "${GNUPGHOME}"{.bak,} cat <TESTATTACHMENT This is a test file. EOF -test_expect_success 'emacs delivery of encrypted message with attachment' \ +test_expect_success GPG 'emacs delivery of encrypted message with attachment' \ 'emacs_deliver_message \ "test encrypted message 001" \ "This is a test encrypted message.\n" \ @@ -176,7 +181,7 @@ Non-text part: application/octet-stream part} body} message}' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -211,7 +216,7 @@ expected='[[[{"id": "XXXXX", "content-type": "application/octet-stream", "filename": "TESTATTACHMENT"}]}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -222,7 +227,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m expected='{"id": 4, "content-type": "text/plain", "content": "This is a test encrypted message.\n"}' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -232,7 +237,7 @@ notmuch show \ --part=5 \ --decrypt \ subject:"test encrypted message 001" >OUTPUT -test_expect_equal_file OUTPUT TESTATTACHMENT +test_expect_equal_file GPG OUTPUT TESTATTACHMENT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} @@ -259,12 +264,12 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/octet-stream"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} -test_expect_success 'emacs delivery of encrypted + signed message' \ +test_expect_success GPG 'emacs delivery of encrypted + signed message' \ 'emacs_deliver_message \ "test encrypted message 002" \ "This is another test encrypted message.\n" \ @@ -299,7 +304,7 @@ expected='[[[{"id": "XXXXX", "content-type": "text/plain", "content": "This is another test encrypted message.\n"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -313,7 +318,7 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite w Non-text part: multipart/encrypted Non-text part: application/pgp-encrypted > This is another test encrypted message.' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -354,7 +359,7 @@ expected='[[[{"id": "XXXXX", {"id": 3, "content-type": "application/pgp-signature"}]}]}, []]]]' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" -- 1.7.4.1