From: Vsevolod Stakhov Date: Sat, 8 Dec 2018 09:47:27 +0000 (+0000) Subject: [Test] Add some tests for greylist module X-Git-Tag: 1.9.0~472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=450314bcaeb463a6de6358e33d84be30301cc8a2;p=thirdparty%2Frspamd.git [Test] Add some tests for greylist module --- diff --git a/test/functional/cases/290_greylist.robot b/test/functional/cases/290_greylist.robot new file mode 100644 index 0000000000..64896fe2bb --- /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 0000000000..5e12accf9c --- /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; +}