]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add multimap test
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Jul 2016 14:20:38 +0000 (15:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Jul 2016 14:20:38 +0000 (15:20 +0100)
test/functional/cases/102_maps.robot [new file with mode: 0644]
test/functional/configs/maps.conf [new file with mode: 0644]

diff --git a/test/functional/cases/102_maps.robot b/test/functional/cases/102_maps.robot
new file mode 100644 (file)
index 0000000..31bf8fc
--- /dev/null
@@ -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 (file)
index 0000000..bb3fad0
--- /dev/null
@@ -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";
+  }
+}