aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-28 15:20:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-28 15:20:38 +0100
commit627f05a8295ed9ae872a683b3b162431aaf7f23c (patch)
treebb921eea6de9cbf058f918e59608aa3f24632d24 /test
parentb871a1e1334570e6548f181cc59c97e5015f61aa (diff)
downloadrspamd-627f05a8295ed9ae872a683b3b162431aaf7f23c.tar.gz
rspamd-627f05a8295ed9ae872a683b3b162431aaf7f23c.zip
[Test] Add multimap test
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_maps.robot20
-rw-r--r--test/functional/configs/maps.conf36
2 files changed, 56 insertions, 0 deletions
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";
+ }
+}