]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Fuzzy skip hashes
authorkorgoth1 <vladislav.stakhov@gmail.com>
Fri, 7 Feb 2020 13:06:11 +0000 (16:06 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Fri, 7 Feb 2020 13:06:11 +0000 (16:06 +0300)
test/functional/cases/120_fuzzy/general.robot
test/functional/cases/120_fuzzy/lib.robot
test/functional/configs/fuzzy.conf
test/functional/configs/maps/skip_hashes.list [new file with mode: 0644]

index eb54f37332b063f3a8fa9868079e523965944565..4b19d5d006c5924299d28a39edd794e784ba8880 100644 (file)
@@ -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
index c7b3ce76867676a90eed2d4132fa92f08badf0f3..3f1fad8070db18fdb7052ca5c0f11008b6dc5d77 100644 (file)
@@ -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}
index 21a5dfbb3f24babe05857f43d26c7933de8f92b6..4a644a8a3b84b5d3097733c651ccf60719404c1b 100644 (file)
@@ -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 (file)
index 0000000..c831fa5
--- /dev/null
@@ -0,0 +1 @@
+670cfcba72a87bab689958a8af5c22593dc17c907836c7c26a74d1bb49add25adfa45a5f172e3af82c9c638e8eb5fc860c22c7e966e61a459165ef0b9e1acc89
\ No newline at end of file