commit ec7eeb6: [Test] Add settings id tests

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jun 10 17:14:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-10 11:54:07 +0100
URL: https://github.com/rspamd/rspamd/commit/ec7eeb63326cdd8b0b9b02e12b9191735fad40ef

[Test] Add settings id tests

---
 test/functional/cases/108_settings.robot | 12 ++++++++++++
 test/functional/configs/settings.conf    | 15 ++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot
index 4ed2b53f5..44d9b8b4d 100644
--- a/test/functional/cases/108_settings.robot
+++ b/test/functional/cases/108_settings.robot
@@ -63,6 +63,18 @@ ENABLE GROUP - NORMAL
   Should Not Contain  ${result.stdout}  SIMPLE_PRE
   Should Not Contain  ${result.stdout}  SIMPLE_POST
 
+SETTINGS ID - NORMAL
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings-Id=id_test
+  Check Rspamc  ${result}  SIMPLE_TEST
+  Should Not Contain  ${result.stdout}  SIMPLE_PRE
+  Should Not Contain  ${result.stdout}  SIMPLE_POST
+
+SETTINGS ID - PRE
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings-Id=id_pre
+  Check Rspamc  ${result}  SIMPLE_PRE
+  Should Not Contain  ${result.stdout}  SIMPLE_TEST
+  Should Not Contain  ${result.stdout}  SIMPLE_POST
+
 *** Keywords ***
 Settings Setup
   ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/settings.conf
diff --git a/test/functional/configs/settings.conf b/test/functional/configs/settings.conf
index d6baa9596..c2b4ba6cc 100644
--- a/test/functional/configs/settings.conf
+++ b/test/functional/configs/settings.conf
@@ -1,3 +1,16 @@
 lua = ${LUA_SCRIPT};
 
-settings { }
+settings {
+  id_test {
+    id = "id_test";
+    apply {
+      symbols_enabled = ["SIMPLE_TEST"];
+    }
+  }
+
+  id_pre { # implicit id
+    apply {
+      symbols_enabled = ["SIMPLE_PRE"];
+    }
+  }
+}


More information about the Commits mailing list