diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-08 09:47:27 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-08 09:47:27 +0000 |
commit | 450314bcaeb463a6de6358e33d84be30301cc8a2 (patch) | |
tree | 79f0bce1d187285b1169415f9fd72eb84ab9781e /test/functional | |
parent | 839f2a48ff0c3eed00c2eb0c0534171b766d1db9 (diff) | |
download | rspamd-450314bcaeb463a6de6358e33d84be30301cc8a2.tar.gz rspamd-450314bcaeb463a6de6358e33d84be30301cc8a2.zip |
[Test] Add some tests for greylist module
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/cases/290_greylist.robot | 39 | ||||
-rw-r--r-- | test/functional/configs/greylist.conf | 11 |
2 files changed, 50 insertions, 0 deletions
diff --git a/test/functional/cases/290_greylist.robot b/test/functional/cases/290_greylist.robot new file mode 100644 index 000000000..64896fe2b --- /dev/null +++ b/test/functional/cases/290_greylist.robot @@ -0,0 +1,39 @@ +*** Settings *** +Suite Setup Greylist Setup +Suite Teardown Greylist 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/spam_message.eml +${REDIS_SCOPE} Suite +${RSPAMD_SCOPE} Suite +${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat + +*** Test Cases *** +GREYLIST NEW + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} GREYLIST (0.00)[greylisted + +GREYLIST EARLY + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} GREYLIST (0.00)[greylisted + +GREYLIST PASS + Sleep 4s Wait greylisting timeout + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} GREYLIST (0.00)[pass + +*** Keywords *** +Greylist Setup + ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/greylist.conf + Set Suite Variable ${PLUGIN_CONFIG} + Generic Setup PLUGIN_CONFIG + Run Redis + +Greylist Teardown + Normal Teardown + Shutdown Process With Children ${REDIS_PID} + Terminate All Processes kill=True
\ No newline at end of file diff --git a/test/functional/configs/greylist.conf b/test/functional/configs/greylist.conf new file mode 100644 index 000000000..5e12accf9 --- /dev/null +++ b/test/functional/configs/greylist.conf @@ -0,0 +1,11 @@ +redis { + servers = "${REDIS_ADDR}:${REDIS_PORT}"; +} +greylist { + check_local = true; + timeout = 4; +} + +actions { + greylist = 1; +} |