]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Empty symbols_enabled / groups_enabled 3379/head
authorAndrew Lewis <nerf@judo.za.org>
Sun, 24 May 2020 10:30:28 +0000 (12:30 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sun, 24 May 2020 10:38:30 +0000 (12:38 +0200)
test/functional/cases/108_settings.robot
test/functional/configs/settings.conf

index d9301e2fa06cc30430335c2ec0e99d00900237b9..76f224653920c9d22032743e083bdeb965215b4d 100644 (file)
@@ -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
index afb221e3d6b20a061016d53688dfacdd90a47ed0..8155ded91989b88b68764b29ca1ffb43d4c50c40 100644 (file)
@@ -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
+}