[PATCH 2/4] test: add 'GPG' prereq to 'crypto' tests
Signed-off-by: Pieter Praet --- test/crypto | 30 ++ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/test/crypto b/test/crypto index 961d035..c2f381c 100755 --- a/test/crypto +++ b/test/crypto @@ -7,6 +7,12 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# GnuPG is a prereq. +if test_expect_success "prereq: GnuPG is present" "which gpg"; then +test_set_prereq GPG +fi + + add_gnupg_home () { local output @@ -31,7 +37,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." \ @@ -66,7 +72,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -103,7 +109,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -139,7 +145,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} @@ -148,7 +154,7 @@ mv "${GNUPGHOME}"{.bak,} catOUTPUT -test_expect_equal_file OUTPUT TESTATTACHMENT +test_expect_equal_file GPG OUTPUT TESTATTACHMENT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} @@ -224,12 +230,12 @@ expected='[[[{"id": "X", "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 a test encrypted message." \ @@ -263,7 +269,7 @@ expected='[[[{"id": "X", "content-type": "text/plain", "content": "This is a test encrypted message.\n"}]}]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -275,7 +281,7 @@ Subject: Re: test encrypted message 002 On 01 Jan 2000 12:00:00 -, Notmuch Test Suite wrote: > This is a test encrypted message.' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -319,7 +325,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" -- 1.7.4.1
[PATCH 2/4] test: add 'GPG' prereq to 'crypto' tests
Signed-off-by: Pieter Praet --- test/crypto | 30 ++ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/test/crypto b/test/crypto index 961d035..c2f381c 100755 --- a/test/crypto +++ b/test/crypto @@ -7,6 +7,12 @@ test_description='PGP/MIME signature verification and decryption' . ./test-lib.sh +# GnuPG is a prereq. +if test_expect_success "prereq: GnuPG is present" "which gpg"; then +test_set_prereq GPG +fi + + add_gnupg_home () { local output @@ -31,7 +37,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." \ @@ -66,7 +72,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -103,7 +109,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -139,7 +145,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" mv "${GNUPGHOME}"{.bak,} @@ -148,7 +154,7 @@ mv "${GNUPGHOME}"{.bak,} catOUTPUT -test_expect_equal_file OUTPUT TESTATTACHMENT +test_expect_equal_file GPG OUTPUT TESTATTACHMENT test_begin_subtest "decryption failure with missing key" mv "${GNUPGHOME}"{,.bak} @@ -224,12 +230,12 @@ expected='[[[{"id": "X", "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 a test encrypted message." \ @@ -263,7 +269,7 @@ expected='[[[{"id": "X", "content-type": "text/plain", "content": "This is a test encrypted message.\n"}]}]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -275,7 +281,7 @@ Subject: Re: test encrypted message 002 On 01 Jan 2000 12:00:00 -, Notmuch Test Suite wrote: > This is a test encrypted message.' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" @@ -319,7 +325,7 @@ expected='[[[{"id": "X", "content-type": "application/pgp-signature"}]} ]}, [' -test_expect_equal \ +test_expect_equal GPG \ "$output" \ "$expected" -- 1.7.4.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch