From 627f05a8295ed9ae872a683b3b162431aaf7f23c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 28 Jul 2016 15:20:38 +0100 Subject: [PATCH] [Test] Add multimap test --- test/functional/cases/102_maps.robot | 20 ++++++++++++++++ test/functional/configs/maps.conf | 36 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 test/functional/cases/102_maps.robot create mode 100644 test/functional/configs/maps.conf 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"; + } +} -- 2.39.5