From 7048dc0475ca9e689fe38c9688774b33c1c9ecee Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 15 Dec 2018 20:18:55 +0000 Subject: [Test] Rbl: Add some tests for RBL module --- test/functional/cases/300_rbl.robot | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/functional/cases/300_rbl.robot (limited to 'test/functional/cases/300_rbl.robot') diff --git a/test/functional/cases/300_rbl.robot b/test/functional/cases/300_rbl.robot new file mode 100644 index 000000000..36d13c045 --- /dev/null +++ b/test/functional/cases/300_rbl.robot @@ -0,0 +1,39 @@ +*** Settings *** +Suite Setup Rbl Setup +Suite Teardown Rbl 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 +${RSPAMD_SCOPE} Suite +${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat + +*** Test Cases *** +RBL FROM MISS + ${result} = Scan Message With Rspamc ${MESSAGE} -i 1.2.3.4 + Check Rspamc ${result} FAKE_RBL_CODE_2 inverse=True + +RBL FROM HIT + ${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.1 + Check Rspamc ${result} FAKE_RBL_CODE_2 + +RBL FROM MULTIPLE HIT + ${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.3 + Check Rspamc ${result} FAKE_RBL_CODE_2 FAKE_RBL_CODE_3 + +RBL FROM UNKNOWN HIT + ${result} = Scan Message With Rspamc ${MESSAGE} -i 4.3.2.2 + Check Rspamc ${result} FAKE_RBL_UNKNOWN + +*** Keywords *** +Rbl Setup + ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/rbl.conf + Set Suite Variable ${PLUGIN_CONFIG} + Generic Setup PLUGIN_CONFIG + +Rbl Teardown + Normal Teardown + Terminate All Processes kill=True \ No newline at end of file -- cgit v1.2.3