diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-15 10:46:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-15 10:46:31 +0100 |
commit | f8718a1191753a141a63ee716aad27df17562df2 (patch) | |
tree | 1255397d6911958fb7dd3120dc088b22c5cfb4ce /test/functional/cases/102_multimap.robot | |
parent | e0accce581bbc83458cf8d720801f3480e62a36b (diff) | |
parent | f3b286c60f4f88509947be71d5d5cb8750f276b5 (diff) | |
download | rspamd-f8718a1191753a141a63ee716aad27df17562df2.tar.gz rspamd-f8718a1191753a141a63ee716aad27df17562df2.zip |
Merge pull request #847 from fatalbanana/mmtest
[Test] Add test for multimap URL maps & filters
Diffstat (limited to 'test/functional/cases/102_multimap.robot')
-rw-r--r-- | test/functional/cases/102_multimap.robot | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot index 03db8c854..36fdb0166 100644 --- a/test/functional/cases/102_multimap.robot +++ b/test/functional/cases/102_multimap.robot @@ -11,6 +11,11 @@ ${MESSAGE} ${TESTDIR}/messages/spam_message.eml ${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml ${REDIS_SCOPE} Suite ${RSPAMD_SCOPE} Suite +${URL1} ${TESTDIR}/messages/url1.eml +${URL2} ${TESTDIR}/messages/url2.eml +${URL3} ${TESTDIR}/messages/url3.eml +${URL4} ${TESTDIR}/messages/url4.eml +${URL5} ${TESTDIR}/messages/url5.eml *** Test Cases *** MAP - DNSBL HIT @@ -142,6 +147,60 @@ MAP - REDIS - FROM MISS ${result} = Scan Message With Rspamc ${MESSAGE} --from user@other.com Check Rspamc ${result} REDIS_FROMADDR inverse=1 +MAP - REDIS - URL TLD - HIT + Redis HSET hostname example.com ${EMPTY} + ${result} = Scan Message With Rspamc ${URL1} + Check Rspamc ${result} REDIS_URL_TLD + +MAP - REDIS - URL TLD - MISS + ${result} = Scan Message With Rspamc ${URL2} + Check Rspamc ${result} REDIS_URL_TLD inverse=1 + +MAP - REDIS - URL RE FULL - HIT + Redis HSET fullurlre html ${EMPTY} + ${result} = Scan Message With Rspamc ${URL2} + Check Rspamc ${result} REDIS_URL_RE_FULL + +MAP - REDIS - URL RE FULL - MISS + ${result} = Scan Message With Rspamc ${URL1} + Check Rspamc ${result} REDIS_URL_RE_FULL inverse=1 + +MAP - REDIS - URL FULL - HIT + Redis HSET fullurl https://www.example.com/foo?a=b ${EMPTY} + ${result} = Scan Message With Rspamc ${URL1} + Check Rspamc ${result} REDIS_URL_FULL + +MAP - REDIS - URL FULL - MISS + ${result} = Scan Message With Rspamc ${URL2} + Check Rspamc ${result} REDIS_URL_FULL inverse=1 + +MAP - REDIS - URL PHISHED - HIT + Redis HSET phishedurl www.rspamd.com ${EMPTY} + ${result} = Scan Message With Rspamc ${URL3} + Check Rspamc ${result} REDIS_URL_PHISHED + +MAP - REDIS - URL PHISHED - MISS + ${result} = Scan Message With Rspamc ${URL4} + Check Rspamc ${result} REDIS_URL_PHISHED inverse=1 + +MAP - REDIS - URL PLAIN REGEX - HIT + Redis HSET urlre www ${EMPTY} + ${result} = Scan Message With Rspamc ${URL3} + Check Rspamc ${result} REDIS_URL_RE_PLAIN + +MAP - REDIS - URL PLAIN REGEX - MISS + ${result} = Scan Message With Rspamc ${URL4} + Check Rspamc ${result} REDIS_URL_RE_PLAIN inverse=1 + +MAP - REDIS - URL TLD REGEX - HIT + Redis HSET tldre net ${EMPTY} + ${result} = Scan Message With Rspamc ${URL5} + Check Rspamc ${result} REDIS_URL_RE_TLD + +MAP - REDIS - URL TLD REGEX - MISS + ${result} = Scan Message With Rspamc ${URL4} + Check Rspamc ${result} REDIS_URL_RE_TLD inverse=1 + *** Keywords *** Multimap Setup ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf |