]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Setting's priority
authorkorgoth1 <vladislav.stakhov@gmail.com>
Wed, 5 Feb 2020 08:57:50 +0000 (11:57 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Wed, 5 Feb 2020 08:57:50 +0000 (11:57 +0300)
test/functional/cases/108_settings.robot
test/functional/configs/settings.conf
test/functional/messages/priority.eml [new file with mode: 0644]

index b7c75af03f9bfa1e5afec7896ef51289fa689eb3..d9301e2fa06cc30430335c2ec0e99d00900237b9 100644 (file)
@@ -9,6 +9,7 @@ Variables       ${TESTDIR}/lib/vars.py
 ${CONFIG}       ${TESTDIR}/configs/plugins.conf
 ${LUA_SCRIPT}   ${TESTDIR}/lua/settings.lua
 ${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
+${MESSAGE_PRIORITY}      ${TESTDIR}/messages/priority.eml
 ${MESSAGE_7BIT}      ${TESTDIR}/messages/utf.eml
 ${MESSAGE_CUSTOM_HDR}      ${TESTDIR}/messages/empty-plain-text.eml
 ${MESSAGE_ABSENT_MIME}      ${TESTDIR}/messages/ed25519.eml
@@ -221,6 +222,11 @@ SETTINGS ID - VIRTUAL DEP
   Should Not Contain  ${result.stdout}  SIMPLE_POST
   Should Not Contain  ${result.stdout}  SIMPLE_PRE
 
+PRIORITY
+  ${result} =  Scan Message With Rspamc  ${MESSAGE_PRIORITY}  --header  Settings-Id=id_virtual_group  --from  user@test.com
+  Should Contain  ${result.stdout}  PRIORITY_2
+
+
 *** Keywords ***
 Settings Setup
   Copy File  ${TESTDIR}/data/bayes.spam.sqlite3  /tmp/bayes.spam.sqlite3
index 0ba4de1c6fb7fb22c652d4d767f0d3198b9f26e3..a5a538e245e123ffa061a214041e9d5b02a2936c 100644 (file)
@@ -15,6 +15,7 @@ settings {
   }
 
   id_virtual {
+  priority = high;
     apply {
       symbols_enabled = ["SIMPLE_VIRTUAL"];
     }
@@ -53,7 +54,21 @@ settings {
       }
     }
   }
+
+  id_test_priority {
+    priority = high;
+    from = "user@test.com";
+    apply {
+      symbols_enabled {
+        PRIORITY = 10.0;
+      }
+      symbols {
+        PRIORITY_2 = 10.0
+      }
+    }
+  }
 }
+
 classifier {
   backend = "sqlite3";
   statfile {
diff --git a/test/functional/messages/priority.eml b/test/functional/messages/priority.eml
new file mode 100644 (file)
index 0000000..2a533ef
--- /dev/null
@@ -0,0 +1,5 @@
+From: user@test.com
+To: undisclosed-recipients;;
+
+Content-Transfer-Encoding: base64
+asdasdlsadklsad
\ No newline at end of file