From: Vsevolod Stakhov Date: Mon, 20 May 2019 17:00:52 +0000 (+0100) Subject: [Test] Add combined maps tests X-Git-Tag: 2.0~873 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa772caba9f33d86faa4fc6bca17db7145417752;p=rspamd.git [Test] Add combined maps tests --- diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot index 5c0dce781..594faf0b6 100644 --- a/test/functional/cases/102_multimap.robot +++ b/test/functional/cases/102_multimap.robot @@ -59,6 +59,26 @@ MAP - FROM ${result} = Scan Message With Rspamc ${MESSAGE} --from user@example.com Check Rspamc ${result} FROM_MAP +MAP - COMBINED IP MASK FROM + ${result} = Scan Message With Rspamc ${MESSAGE} -i 10.1.0.10 --from user@example.com + Check Rspamc ${result} COMBINED_MAP_AND + Check Rspamc ${result} COMBINED_MAP_OR + +MAP - COMBINED IP MASK ONLY + ${result} = Scan Message With Rspamc ${MESSAGE} -i 10.1.0.10 + Check Rspamc ${result} COMBINED_MAP_AND inverse=1 + Check Rspamc ${result} COMBINED_MAP_OR + +MAP - COMBINED FROM ONLY + ${result} = Scan Message With Rspamc ${MESSAGE} --from user@example.com + Check Rspamc ${result} COMBINED_MAP_AND inverse=1 + Check Rspamc ${result} COMBINED_MAP_OR + +MAP - COMBINED MISS + ${result} = Scan Message With Rspamc ${MESSAGE} -i 11.1.0.10 --from user@other.com + Check Rspamc ${result} COMBINED_MAP_AND inverse=1 + Check Rspamc ${result} COMBINED_MAP_OR inverse=1 + MAP - FROM MISS ${result} = Scan Message With Rspamc ${MESSAGE} --from user@other.com Check Rspamc ${result} FROM_MAP inverse=1 diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf index 77326f26c..f003ec96e 100644 --- a/test/functional/configs/multimap.conf +++ b/test/functional/configs/multimap.conf @@ -157,4 +157,34 @@ multimap { map = "${TESTDIR}/configs/maps/rcvd2.list"; flags = ["authenticated", "ssl"]; } + COMBINED_MAP_AND { + type = "combined"; + rules { + ip = { + type = "radix"; + map = "${TESTDIR}/configs/maps/ip.list"; + selector = "ip"; + } + from { + map = "${TESTDIR}/configs/maps/domains.list"; + selector = "from:domain"; + } + } + expression = "from & ip" + } + COMBINED_MAP_OR { + type = "combined"; + rules { + ip = { + type = "radix"; + map = "${TESTDIR}/configs/maps/ip.list"; + selector = "ip"; + } + from { + map = "${TESTDIR}/configs/maps/domains.list"; + selector = "from:domain"; + } + } + expression = "from || ip" + } }