]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add settings id tests
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 10 Jun 2019 10:54:07 +0000 (11:54 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 10 Jun 2019 10:54:07 +0000 (11:54 +0100)
test/functional/cases/108_settings.robot
test/functional/configs/settings.conf

index 4ed2b53f5f52d1784565c880882b2633732a15ec..44d9b8b4d63eb1af35b61c4a3180d201f5a508bd 100644 (file)
@@ -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
index d6baa9596538b18f6a9095efd2eb2d1502590083..c2b4ba6cc5dd26bb12486d326561c61669f0ee08 100644 (file)
@@ -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"];
+    }
+  }
+}