From: Andrew Lewis Date: Mon, 15 Aug 2016 13:27:37 +0000 (+0200) Subject: [Test] Additions for multimap & proxy tests X-Git-Tag: 1.3.4~53^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F849%2Fhead;p=rspamd.git [Test] Additions for multimap & proxy tests - Test unfiltered URL map - Test SPAMC & RSPAMC protocols at proxy --- 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"; + } }