summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2020-05-24 12:30:28 +0200
committerAndrew Lewis <nerf@judo.za.org>2020-05-24 12:38:30 +0200
commit80cb86e2096e213ceb781deb11c4fd87ecda8266 (patch)
treea0e4add47d30f016b1ce36817a5b072510e489da /test
parent38bee248b223d279c9294cd8944e32a9a0867db0 (diff)
downloadrspamd-80cb86e2096e213ceb781deb11c4fd87ecda8266.tar.gz
rspamd-80cb86e2096e213ceb781deb11c4fd87ecda8266.zip
[Test] Empty symbols_enabled / groups_enabled
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/108_settings.robot25
-rw-r--r--test/functional/configs/settings.conf16
2 files changed, 40 insertions, 1 deletions
diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot
index d9301e2fa..76f224653 100644
--- a/test/functional/cases/108_settings.robot
+++ b/test/functional/cases/108_settings.robot
@@ -18,6 +18,15 @@ ${HAM_MESSAGE} ${TESTDIR}/messages/ham.eml
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+*** Keywords ***
+Check Everything Disabled
+ [Arguments] ${result}
+ Check Rspamc ${result} Action: no action
+ Should Not Contain ${result.stdout} SIMPLE_VIRTUAL
+ Should Not Contain ${result.stdout} SIMPLE_PRE
+ Should Not Contain ${result.stdout} SIMPLE_POST
+ Should Not Contain ${result.stdout} BAYES_SPAM
+
*** Test Cases ***
NO SETTINGS SPAM
${result} = Scan Message With Rspamc ${SPAM_MESSAGE}
@@ -35,6 +44,22 @@ NO SETTINGS HAM
Should Contain ${result.stdout} SIMPLE_POST
Should Contain ${result.stdout} BAYES_HAM
+EMPTY SYMBOLS ENABLED - STATIC
+ ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} -i 5.5.5.5
+ Check Everything Disabled ${result}
+
+EMPTY GROUPS ENABLED - STATIC
+ ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} -i 5.5.5.6
+ Check Everything Disabled ${result}
+
+EMPTY SYMBOLS ENABLED - SETTINGS-ID
+ ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} --header Settings-Id=empty_symbols_enabled
+ Check Everything Disabled ${result}
+
+EMPTY GROUPS ENABLED - SETTINGS-ID
+ ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} --header Settings-Id=empty_groups_enabled
+ Check Everything Disabled ${result}
+
ENABLE SYMBOL - NORMAL
${result} = Scan Message With Rspamc ${HAM_MESSAGE} --header Settings={symbols_enabled = ["SIMPLE_TEST"]}
Check Rspamc ${result} SIMPLE_TEST
diff --git a/test/functional/configs/settings.conf b/test/functional/configs/settings.conf
index afb221e3d..8155ded91 100644
--- a/test/functional/configs/settings.conf
+++ b/test/functional/configs/settings.conf
@@ -66,6 +66,20 @@ settings {
}
}
}
+
+ empty_symbols_enabled {
+ ip = "5.5.5.5";
+ apply {
+ symbols_enabled = [];
+ }
+ }
+
+ empty_groups_enabled {
+ ip = "5.5.5.6";
+ apply {
+ groups_enabled = [];
+ }
+ }
}
classifier {
@@ -82,4 +96,4 @@ classifier {
}
min_learns = 1;
min_token_hits = 1;
-} \ No newline at end of file
+}