diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-09 12:43:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-09 12:43:51 +0100 |
commit | 4e9c57b2182b43e60ac8454b0eaadf5b5612e4be (patch) | |
tree | 06b01113c649ae991d901512bb08cae6a558c9f0 /test/functional | |
parent | a6223eecc74c5ecbe48ff3265bb4c9b62c0c3dd7 (diff) | |
download | rspamd-4e9c57b2182b43e60ac8454b0eaadf5b5612e4be.tar.gz rspamd-4e9c57b2182b43e60ac8454b0eaadf5b5612e4be.zip |
[Test] Add tests for sign maps
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/cases/131_dkim_signing/007_sign_maps.robot | 34 | ||||
-rw-r--r-- | test/functional/configs/dkim_signing/sign_maps.conf | 9 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/cases/131_dkim_signing/007_sign_maps.robot b/test/functional/cases/131_dkim_signing/007_sign_maps.robot new file mode 100644 index 000000000..69d4c9a92 --- /dev/null +++ b/test/functional/cases/131_dkim_signing/007_sign_maps.robot @@ -0,0 +1,34 @@ +*** 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 +${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.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@cacophony.za.org + Check Rspamc ${result} DKIM-Signature: + Should Contain ${result.stdout} DKIM_SIGNED + +TEST NOT SIGNED - FROM WRONG DOMAIN + ${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@cacophony.za.org + Check Rspamc ${result} DKIM-Signature: inverse=1 + Should Not Contain ${result.stdout} DKIM_SIGNED + +*** Keywords *** +DKIM Signing Setup + ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/sign_maps.conf + Set Suite Variable ${PLUGIN_CONFIG} + Generic Setup PLUGIN_CONFIG + +DKIM Signing Teardown + Normal Teardown diff --git a/test/functional/configs/dkim_signing/sign_maps.conf b/test/functional/configs/dkim_signing/sign_maps.conf new file mode 100644 index 000000000..9e63b7fc4 --- /dev/null +++ b/test/functional/configs/dkim_signing/sign_maps.conf @@ -0,0 +1,9 @@ +dkim_signing { + signing_table = [ + "*@cacophony.za.org cacophony.za.org", + ]; + + key_table = [ + "cacophony.za.org %:eddsa:m5kGxtckRfsNe5EuYTe7bvkDjSh7LXaX3aXyIMPGLR0=", + ]; +}
\ No newline at end of file |