From: Andrew Lewis Date: Mon, 6 Mar 2017 16:41:34 +0000 (+0200) Subject: [Test] Basic tests for DKIM signing module X-Git-Tag: 1.5.2~10^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=14223b81a96ac5552d81c88113cf89e7b1bf6b97;p=rspamd.git [Test] Basic tests for DKIM signing module --- diff --git a/test/functional/cases/131_dkim_signing.robot b/test/functional/cases/131_dkim_signing.robot new file mode 100644 index 000000000..58f608b8f --- /dev/null +++ b/test/functional/cases/131_dkim_signing.robot @@ -0,0 +1,33 @@ +*** Settings *** +Suite Setup DKIM Signing Setup +Suite Teardown DKIM Signing Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/plugins.conf +${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml +${REDIS_SCOPE} Suite +${RSPAMD_SCOPE} Suite +${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat + +*** Test Cases *** +TEST SIGNED + ${result} = Scan Message With Rspamc ${MESSAGE} -u bob@rspamd.tk + Check Rspamc ${result} DKIM-Signature: + Should Contain ${result.stdout} DKIM_SIGNED (1.00) + +TEST NOT SIGNED - USERNAME WRONG DOMAIN + ${result} = Scan Message With Rspamc ${MESSAGE} -u bob@example.tk + Check Rspamc ${result} DKIM-Signature: inverse=1 + Should Not Contain ${result.stdout} DKIM_SIGNED (1.00) + +*** Keywords *** +DKIM Signing Setup + ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing.conf + Set Suite Variable ${PLUGIN_CONFIG} + Generic Setup PLUGIN_CONFIG + +DKIM Signing Teardown + Normal Teardown diff --git a/test/functional/configs/dkim_signing.conf b/test/functional/configs/dkim_signing.conf new file mode 100644 index 000000000..d233beff6 --- /dev/null +++ b/test/functional/configs/dkim_signing.conf @@ -0,0 +1,3 @@ +dkim_signing { + path = "${TESTDIR}/configs/dkim.key"; +}