aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-15 15:27:37 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-08-15 15:27:37 +0200
commit46189ebfbd851595f182e255f17ec9fad9b76459 (patch)
treeb2e2e609967519f53cb6622e175c9d4363bbcfdc /test
parente67ced158a0cac42f6b89a18552dbd69c8f67c54 (diff)
downloadrspamd-46189ebfbd851595f182e255f17ec9fad9b76459.tar.gz
rspamd-46189ebfbd851595f182e255f17ec9fad9b76459.zip
[Test] Additions for multimap & proxy tests
- Test unfiltered URL map - Test SPAMC & RSPAMC protocols at proxy
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_multimap.robot9
-rw-r--r--test/functional/cases/140_proxy.robot14
-rw-r--r--test/functional/configs/multimap.conf4
3 files changed, 26 insertions, 1 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index 36fdb0166..364787b15 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -201,6 +201,15 @@ MAP - REDIS - URL TLD REGEX - MISS
${result} = Scan Message With Rspamc ${URL4}
Check Rspamc ${result} REDIS_URL_RE_TLD inverse=1
+MAP - REDIS - URL NOFILTER - HIT
+ Redis HSET urlnofilter www.example.net ${EMPTY}
+ ${result} = Scan Message With Rspamc ${URL5}
+ Check Rspamc ${result} REDIS_URL_NOFILTER
+
+MAP - REDIS - URL NOFILTER - MISS
+ ${result} = Scan Message With Rspamc ${URL4}
+ Check Rspamc ${result} REDIS_URL_NOFILTER inverse=1
+
*** Keywords ***
Multimap Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf
diff --git a/test/functional/cases/140_proxy.robot b/test/functional/cases/140_proxy.robot
index 3907cfed6..7b29f188a 100644
--- a/test/functional/cases/140_proxy.robot
+++ b/test/functional/cases/140_proxy.robot
@@ -11,7 +11,7 @@ ${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
-Scan Message
+Rspamc Client
${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_PROXY} -p ${MESSAGE}
Custom Follow Rspamd Log ${PROXY_TMPDIR}/rspamd.log ${PROXY_LOGPOS} PROXY_LOGPOS Suite
Custom Follow Rspamd Log ${SLAVE_TMPDIR}/rspamd.log ${SLAVE_LOGPOS} SLAVE_LOGPOS Suite
@@ -19,6 +19,18 @@ Scan Message
Should Contain ${result.stdout} SIMPLE_TEST
Should Be Equal As Integers ${result.rc} 0
+SPAMC
+ ${result} = Spamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
+ Custom Follow Rspamd Log ${PROXY_TMPDIR}/rspamd.log ${PROXY_LOGPOS} PROXY_LOGPOS Suite
+ Custom Follow Rspamd Log ${SLAVE_TMPDIR}/rspamd.log ${SLAVE_LOGPOS} SLAVE_LOGPOS Suite
+ Should Contain ${result} SIMPLE_TEST
+
+RSPAMC Legacy Protocol
+ ${result} = Rspamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
+ Custom Follow Rspamd Log ${PROXY_TMPDIR}/rspamd.log ${PROXY_LOGPOS} PROXY_LOGPOS Suite
+ Custom Follow Rspamd Log ${SLAVE_TMPDIR}/rspamd.log ${SLAVE_LOGPOS} SLAVE_LOGPOS Suite
+ Should Contain ${result} SIMPLE_TEST
+
*** Keywords ***
Proxy Setup
&{d} = Run Rspamd CONFIG=${TESTDIR}/configs/lua_test.conf
diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf
index e993b1f7d..96258c15a 100644
--- a/test/functional/configs/multimap.conf
+++ b/test/functional/configs/multimap.conf
@@ -92,4 +92,8 @@ multimap {
map = "redis://urlre";
filter = "regexp:/^(www)/";
}
+ REDIS_URL_NOFILTER {
+ type = "url";
+ map = "redis://urlnofilter";
+ }
}