]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
test: add fuzzy tests for split, read-only, and write-only server modes
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 1 May 2025 08:32:48 +0000 (09:32 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 1 May 2025 08:32:48 +0000 (09:32 +0100)
test/functional/cases/120_fuzzy/lib.robot
test/functional/cases/120_fuzzy/read-only.robot [new file with mode: 0644]
test/functional/cases/120_fuzzy/split-servers.robot [new file with mode: 0644]
test/functional/cases/120_fuzzy/write-only.robot [new file with mode: 0644]

index fda0af54a06e45958c12c4330664bcb8431b117a..0a69c0ae981e2ab8fd51df2717ecca43228b73ba 100644 (file)
@@ -16,6 +16,7 @@ ${RSPAMD_FUZZY_ENCRYPTED_ONLY}  false
 ${RSPAMD_FUZZY_ENCRYPTION_KEY}  null
 ${RSPAMD_FUZZY_INCLUDE}         ${RSPAMD_TESTDIR}/configs/empty.conf
 ${RSPAMD_FUZZY_KEY}             null
+${RSPAMD_FUZZY_SERVER_MODE}     servers
 ${RSPAMD_FUZZY_SHINGLES_KEY}    null
 ${RSPAMD_SCOPE}                 Suite
 ${SETTINGS_FUZZY_CHECK}         ${EMPTY}
@@ -109,6 +110,7 @@ Fuzzy Setup Encrypted
   Set Suite Variable  ${RSPAMD_FUZZY_ENCRYPTION_KEY}  ${RSPAMD_KEY_PUB1}
   Set Suite Variable  ${RSPAMD_FUZZY_CLIENT_ENCRYPTION_KEY}  ${RSPAMD_KEY_PUB1}
   Set Suite Variable  ${RSPAMD_FUZZY_INCLUDE}  ${RSPAMD_TESTDIR}/configs/fuzzy-encryption-key.conf
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  servers
   Rspamd Redis Setup
 
 Fuzzy Setup Encrypted Dyn1
@@ -142,6 +144,7 @@ Fuzzy Setup Encrypted Keyed
 Fuzzy Setup Plain
   [Arguments]  ${algorithm}
   Set Suite Variable  ${RSPAMD_FUZZY_ALGORITHM}  ${algorithm}
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  servers
   Rspamd Redis Setup
 
 Fuzzy Setup Keyed
@@ -149,6 +152,7 @@ Fuzzy Setup Keyed
   Set Suite Variable  ${RSPAMD_FUZZY_ALGORITHM}  ${algorithm}
   Set Suite Variable  ${RSPAMD_FUZZY_KEY}  mYN888sydwLTfE32g2hN
   Set Suite Variable  ${RSPAMD_FUZZY_SHINGLES_KEY}  hXUCgul9yYY3Zlk1QIT2
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  servers
   Rspamd Redis Setup
 
 Fuzzy Setup Plain Fasthash
@@ -218,3 +222,18 @@ Fuzzy Multimessage Overwrite Test
   FOR  ${i}  IN  @{MESSAGES}
     Fuzzy Overwrite Test  ${i}
   END
+
+Fuzzy Setup Split Servers
+  Set Suite Variable  ${RSPAMD_FUZZY_ALGORITHM}  siphash
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  split
+  Rspamd Redis Setup
+
+Fuzzy Setup Read Only
+  Set Suite Variable  ${RSPAMD_FUZZY_ALGORITHM}  siphash
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  read_only
+  Rspamd Redis Setup
+
+Fuzzy Setup Write Only
+  Set Suite Variable  ${RSPAMD_FUZZY_ALGORITHM}  siphash
+  Set Suite Variable  ${RSPAMD_FUZZY_SERVER_MODE}  write_only
+  Rspamd Redis Setup
diff --git a/test/functional/cases/120_fuzzy/read-only.robot b/test/functional/cases/120_fuzzy/read-only.robot
new file mode 100644 (file)
index 0000000..0c3be7f
--- /dev/null
@@ -0,0 +1,14 @@
+*** Settings ***
+Suite Setup     Fuzzy Setup Read Only
+Suite Teardown  Rspamd Redis Teardown
+Resource        lib.robot
+
+*** Test Cases ***
+Fuzzy Add
+  Fuzzy Multimessage Add Test
+
+Fuzzy Fuzzy
+  Fuzzy Multimessage Fuzzy Test
+
+Fuzzy Miss
+  Fuzzy Multimessage Miss Test
diff --git a/test/functional/cases/120_fuzzy/split-servers.robot b/test/functional/cases/120_fuzzy/split-servers.robot
new file mode 100644 (file)
index 0000000..97d7a77
--- /dev/null
@@ -0,0 +1,14 @@
+*** Settings ***
+Suite Setup     Fuzzy Setup Split Servers
+Suite Teardown  Rspamd Redis Teardown
+Resource        lib.robot
+
+*** Test Cases ***
+Fuzzy Add
+  Fuzzy Multimessage Add Test
+
+Fuzzy Fuzzy
+  Fuzzy Multimessage Fuzzy Test
+
+Fuzzy Miss
+  Fuzzy Multimessage Miss Test
diff --git a/test/functional/cases/120_fuzzy/write-only.robot b/test/functional/cases/120_fuzzy/write-only.robot
new file mode 100644 (file)
index 0000000..ee017a1
--- /dev/null
@@ -0,0 +1,14 @@
+*** Settings ***
+Suite Setup     Fuzzy Setup Write Only
+Suite Teardown  Rspamd Redis Teardown
+Resource        lib.robot
+
+*** Test Cases ***
+Fuzzy Add
+  Fuzzy Multimessage Add Test
+
+Fuzzy Fuzzy
+  Fuzzy Multimessage Fuzzy Test
+
+Fuzzy Miss
+  Fuzzy Multimessage Miss Test