From: Vsevolod Stakhov Date: Thu, 28 Jul 2016 14:20:38 +0000 (+0100) Subject: [Test] Add multimap test X-Git-Tag: 1.3.1~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=627f05a8295ed9ae872a683b3b162431aaf7f23c;p=rspamd.git [Test] Add multimap test --- diff --git a/test/functional/cases/102_maps.robot b/test/functional/cases/102_maps.robot new file mode 100644 index 000000000..31bf8fc66 --- /dev/null +++ b/test/functional/cases/102_maps.robot @@ -0,0 +1,20 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/maps.conf +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${RSPAMD_SCOPE} Suite + +*** Test Cases *** +MAP - DNSBL HIT + ${result} = Scan Message With Rspamc ${MESSAGE} -i 127.0.0.2 + Check Rspamc ${result} DNSBL_MAP + +MAP - DNSBL MISS + ${result} = Scan Message With Rspamc ${MESSAGE} -i 127.0.0.1 + Check Rspamc ${result} DNSBL_MAP inverse=1 rc_nocheck=1 \ No newline at end of file diff --git a/test/functional/configs/maps.conf b/test/functional/configs/maps.conf new file mode 100644 index 000000000..bb3fad0d5 --- /dev/null +++ b/test/functional/configs/maps.conf @@ -0,0 +1,36 @@ +options = { + filters = ["spf", "dkim", "regexp"] + url_tld = "${TESTDIR}/../lua/unit/test_tld.dat" + pidfile = "${TMPDIR}/rspamd.pid" +} +logging = { + type = "file", + level = "debug" + filename = "${TMPDIR}/rspamd.log" +} +metric = { + name = "default", + actions = { + reject = 100500, + } + unknown_weight = 1 +} + +worker { + type = normal + bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL} + count = 1 + keypair { + pubkey = "${KEY_PUB1}"; + privkey = "${KEY_PVT1}"; + } +} +modules { + path = "${TESTDIR}/../../src/plugins/lua/" +} +multimap { + DNSBL_MAP { + type = "dnsbl"; + map = "rspamd.com"; + } +}