mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
tests: Detect buggy dkimpy versions, and skip the test if needed
Some dkimpy versions have a bug where it can't parse the keys generated by its own key generator. That causes the dkimpy test to fail. See https://bugs.launchpad.net/dkimpy/+bug/1978835 for more details. This patch adds a workaround which detects the buggy version, and skip the test if needed.
This commit is contained in:
@@ -28,6 +28,16 @@ fi
|
||||
generate_certs_for testserver
|
||||
( mkdir -p .dkimcerts; cd .dkimcerts; dknewkey private > log 2>&1 )
|
||||
|
||||
# Some dkimpy versions have a bug where it can't parse the keys generated by
|
||||
# its own key generator. Detect if that's the case, and if so, skip the test.
|
||||
# See https://bugs.launchpad.net/dkimpy/+bug/1978835.
|
||||
if ! /usr/bin/dkimsign \
|
||||
testselector1 testserver .dkimcerts/private.key \
|
||||
< content 2>&1 | grep -q "DKIM-Signature:"
|
||||
then
|
||||
skip "buggy dkimpy version"
|
||||
fi
|
||||
|
||||
add_user user@testserver secretpassword
|
||||
add_user someone@testserver secretpassword
|
||||
|
||||
@@ -40,7 +50,9 @@ wait_until_ready 1025
|
||||
run_msmtp someone@testserver < content
|
||||
wait_for_file .mail/someone@testserver
|
||||
mail_diff content .mail/someone@testserver
|
||||
grep -q "DKIM-Signature:" .mail/someone@testserver
|
||||
if ! grep -q "DKIM-Signature:" .mail/someone@testserver; then
|
||||
fail "mail not signed, DKIM-Signature header missing"
|
||||
fi
|
||||
|
||||
# Verify the signature manually, just in case.
|
||||
# NOTE: This is using driusan/dkim instead of dkimpy, because dkimpy can't be
|
||||
|
||||
Reference in New Issue
Block a user