aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-12 15:42:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-12 15:42:58 +0100
commite29277ca2048c114459ca7c6c6b25b6e1e0f2ee1 (patch)
treea88e2b542d728467068576a293f605ccb130f0c9 /test
parentcdc100b748c784d1c8e55aee647dfed53b6df893 (diff)
downloadrspamd-e29277ca2048c114459ca7c6c6b25b6e1e0f2ee1.tar.gz
rspamd-e29277ca2048c114459ca7c6c6b25b6e1e0f2ee1.zip
[Feature] Add maps based on Top Level Domains
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_multimap.robot8
-rw-r--r--test/functional/configs/maps/top.list2
-rw-r--r--test/functional/configs/multimap.conf5
3 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index c46fff39b..7aac43e4e 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -133,6 +133,14 @@ MAP - HOSTNAME MISS
${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname rspamd.com
Check Rspamc ${result} HOSTNAME_MAP inverse=1
+MAP - TOP
+ ${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com.au
+ Check Rspamc ${result} HOSTNAME_TOP_MAP
+
+MAP - TOP MISS
+ ${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com.bg
+ Check Rspamc ${result} HOSTNAME_TOP_MAP inverse=1
+
MAP - CDB - HOSTNAME
${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com
Check Rspamc ${result} CDB_HOSTNAME
diff --git a/test/functional/configs/maps/top.list b/test/functional/configs/maps/top.list
new file mode 100644
index 000000000..d8a152ed8
--- /dev/null
+++ b/test/functional/configs/maps/top.list
@@ -0,0 +1,2 @@
+au
+#bg \ No newline at end of file
diff --git a/test/functional/configs/multimap.conf b/test/functional/configs/multimap.conf
index 98701794f..61bd310a8 100644
--- a/test/functional/configs/multimap.conf
+++ b/test/functional/configs/multimap.conf
@@ -58,6 +58,11 @@ multimap {
type = "hostname";
map = "${TESTDIR}/configs/maps/domains.list";
}
+ HOSTNAME_TOP_MAP {
+ type = "hostname";
+ filter = "top";
+ map = "${TESTDIR}/configs/maps/top.list";
+ }
CDB_HOSTNAME {
type = "hostname";
map = "cdb://${TESTDIR}/configs/maps/domains.cdb";