From fa772caba9f33d86faa4fc6bca17db7145417752 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 20 May 2019 18:00:52 +0100 Subject: [PATCH] [Test] Add combined maps tests --- test/functional/cases/102_multimap.robot | 20 ++++++++++++++++ test/functional/configs/multimap.conf | 30 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) 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" + } } -- 2.39.5