From 7c5dd8a88d84f3a50011045c093264a7985ba4c5 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Wed, 5 Feb 2020 11:57:50 +0300 Subject: [PATCH] [Test] Setting's priority --- test/functional/cases/108_settings.robot | 6 ++++++ test/functional/configs/settings.conf | 15 +++++++++++++++ test/functional/messages/priority.eml | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 test/functional/messages/priority.eml diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot index b7c75af03..d9301e2fa 100644 --- a/test/functional/cases/108_settings.robot +++ b/test/functional/cases/108_settings.robot @@ -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 diff --git a/test/functional/configs/settings.conf b/test/functional/configs/settings.conf index 0ba4de1c6..a5a538e24 100644 --- a/test/functional/configs/settings.conf +++ b/test/functional/configs/settings.conf @@ -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 index 000000000..2a533efb7 --- /dev/null +++ b/test/functional/messages/priority.eml @@ -0,0 +1,5 @@ +From: user@test.com +To: undisclosed-recipients;; + +Content-Transfer-Encoding: base64 +asdasdlsadklsad \ No newline at end of file -- 2.39.5