diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-11-25 01:53:55 -0500 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-25 07:46:31 -0700 |
commit | 93d309e682c0910556d79aa75c8871cb3f6860ae (patch) | |
tree | 5cfa34def592600524cc28ee9dcd7eae54f8988c /tests/email-print-mime-structure.sh | |
parent | e9e26fa3d84b9d38c4a33fb33f890b21b482ef13 (diff) | |
download | mailscripts-93d309e682c0910556d79aa75c8871cb3f6860ae.tar.gz |
email-print-mime-structure: added test for PGP/MIME decryption
The secret key material in this test comes from
https://datatracker.ietf.org/doc/draft-bre-openpgp-samples/
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'tests/email-print-mime-structure.sh')
-rwxr-xr-x | tests/email-print-mime-structure.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/email-print-mime-structure.sh b/tests/email-print-mime-structure.sh index 5efa2ca..0c0bb50 100755 --- a/tests/email-print-mime-structure.sh +++ b/tests/email-print-mime-structure.sh @@ -2,7 +2,20 @@ set -e +test_eml() { + message="$1" + shift + diff -u "$message.out" <(./email-print-mime-structure "$@" < "$message.eml") +} + for eml in tests/email-print-mime-structure/*.eml; do - printf "Testing %s\n" "${eml##*/}" - diff -u "${eml%%.eml}.out" <(./email-print-mime-structure < "$eml") + base="${eml%%.eml}" + pgpkey="$base.pgpkey" + if [ -e "$pgpkey" ]; then + printf "Testing %s (PGPy)\n" "${eml##*/}" + test_eml "$base" --pgpkey "$pgpkey" + else + printf "Testing %s\n" "${eml##*/}" + test_eml "$base" + fi done |