commit 594fed5: [Test] Fuzzy skip hashes
korgoth1
vladislav.stakhov at gmail.com
Sun Feb 9 21:07:08 UTC 2020
Author: korgoth1
Date: 2020-02-07 16:06:11 +0300
URL: https://github.com/rspamd/rspamd/commit/594fed570755ced63f5849918e09691caf4d672c
[Test] Fuzzy skip hashes
---
test/functional/cases/120_fuzzy/general.robot | 3 +++
test/functional/cases/120_fuzzy/lib.robot | 16 ++++++++++++++++
test/functional/configs/fuzzy.conf | 1 +
test/functional/configs/maps/skip_hashes.list | 1 +
4 files changed, 21 insertions(+)
diff --git a/test/functional/cases/120_fuzzy/general.robot b/test/functional/cases/120_fuzzy/general.robot
index eb54f3733..4b19d5d00 100644
--- a/test/functional/cases/120_fuzzy/general.robot
+++ b/test/functional/cases/120_fuzzy/general.robot
@@ -12,3 +12,6 @@ Fuzzy Delete
Fuzzy Overwrite
Fuzzy Multimessage Overwrite Test
+
+Fuzzy Skip Hash Test
+ Fuzzy Skip Hash Test Message
\ No newline at end of file
diff --git a/test/functional/cases/120_fuzzy/lib.robot b/test/functional/cases/120_fuzzy/lib.robot
index c7b3ce768..3f1fad807 100644
--- a/test/functional/cases/120_fuzzy/lib.robot
+++ b/test/functional/cases/120_fuzzy/lib.robot
@@ -12,6 +12,7 @@ ${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED
${FLAG2_NUMBER} 51
${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE
@{MESSAGES} ${TESTDIR}/messages/spam_message.eml ${TESTDIR}/messages/zip.eml
+@{MESSAGES_SKIP} ${TESTDIR}/messages/priority.eml
@{RANDOM_MESSAGES} ${TESTDIR}/messages/bad_message.eml ${TESTDIR}/messages/zip-doublebad.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
@@ -19,6 +20,16 @@ ${SETTINGS_FUZZY_WORKER} ${EMPTY}
${SETTINGS_FUZZY_CHECK} ${EMPTY}
*** Keywords ***
+Fuzzy Skip Add Test Base
+ [Arguments] ${message}
+ Set Suite Variable ${RSPAMD_FUZZY_ADD_${message}} 0
+ ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 -f
+ ... ${FLAG1_NUMBER} fuzzy_add ${message}
+ Check Rspamc ${result}
+ Sync Fuzzy Storage
+ ${result} = Scan Message With Rspamc ${message}
+ Should Not Contain ${result.stdout} R_TEST_FUZZY_DENIED
+
Fuzzy Add Test
[Arguments] ${message}
Set Suite Variable ${RSPAMD_FUZZY_ADD_${message}} 0
@@ -130,6 +141,11 @@ Fuzzy Setup Keyed Xxhash
Fuzzy Setup Encrypted Siphash
Fuzzy Setup Encrypted siphash
+Fuzzy Skip Hash Test Message
+ FOR ${i} IN @{MESSAGES_SKIP}
+ Fuzzy Skip Add Test Base ${i}
+ END
+
Fuzzy Multimessage Add Test
FOR ${i} IN @{MESSAGES}
Fuzzy Add Test ${i}
diff --git a/test/functional/configs/fuzzy.conf b/test/functional/configs/fuzzy.conf
index 21a5dfbb3..4a644a8a3 100644
--- a/test/functional/configs/fuzzy.conf
+++ b/test/functional/configs/fuzzy.conf
@@ -72,6 +72,7 @@ fuzzy_check {
mime_types = ["application/*"];
read_only = false;
skip_unknown = true;
+ skip_hashes = "${TESTDIR}/configs/maps/skip_hashes.list";
${SETTINGS_FUZZY_CHECK}
fuzzy_map = {
${FLAG1_SYMBOL} {
diff --git a/test/functional/configs/maps/skip_hashes.list b/test/functional/configs/maps/skip_hashes.list
new file mode 100644
index 000000000..c831fa5a6
--- /dev/null
+++ b/test/functional/configs/maps/skip_hashes.list
@@ -0,0 +1 @@
+670cfcba72a87bab689958a8af5c22593dc17c907836c7c26a74d1bb49add25adfa45a5f172e3af82c9c638e8eb5fc860c22c7e966e61a459165ef0b9e1acc89
\ No newline at end of file
More information about the Commits
mailing list