From 46189ebfbd851595f182e255f17ec9fad9b76459 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 15 Aug 2016 15:27:37 +0200 Subject: [PATCH] [Test] Additions for multimap & proxy tests - Test unfiltered URL map - Test SPAMC & RSPAMC protocols at proxy --- test/functional/cases/102_multimap.robot | 9 +++++++++ test/functional/cases/140_proxy.robot | 14 +++++++++++++- test/functional/configs/multimap.conf | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) 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"; + } } -- 2.39.5