commit 80cb86e: [Test] Empty symbols_enabled / groups_enabled

Andrew Lewis nerf at judo.za.org
Sun May 24 19:49:08 UTC 2020


Author: Andrew Lewis
Date: 2020-05-24 12:30:28 +0200
URL: https://github.com/rspamd/rspamd/commit/80cb86e2096e213ceb781deb11c4fd87ecda8266 (refs/pull/3379/head)

[Test] Empty symbols_enabled / groups_enabled

---
 test/functional/cases/108_settings.robot | 25 +++++++++++++++++++++++++
 test/functional/configs/settings.conf    | 16 +++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

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
+}


More information about the Commits mailing list