From b0daade6a0ea891e62f10534a0c634be9df72a25 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 1 May 2025 09:32:48 +0100 Subject: [PATCH] test: add fuzzy tests for split, read-only, and write-only server modes --- test/functional/cases/120_fuzzy/lib.robot | 19 +++++++++++++++++++ .../cases/120_fuzzy/read-only.robot | 14 ++++++++++++++ .../cases/120_fuzzy/split-servers.robot | 14 ++++++++++++++ .../cases/120_fuzzy/write-only.robot | 14 ++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 test/functional/cases/120_fuzzy/read-only.robot create mode 100644 test/functional/cases/120_fuzzy/split-servers.robot create mode 100644 test/functional/cases/120_fuzzy/write-only.robot diff --git a/test/functional/cases/120_fuzzy/lib.robot b/test/functional/cases/120_fuzzy/lib.robot index fda0af54a0..0a69c0ae98 100644 --- a/test/functional/cases/120_fuzzy/lib.robot +++ b/test/functional/cases/120_fuzzy/lib.robot @@ -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 index 0000000000..0c3be7fec1 --- /dev/null +++ b/test/functional/cases/120_fuzzy/read-only.robot @@ -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 index 0000000000..97d7a7756d --- /dev/null +++ b/test/functional/cases/120_fuzzy/split-servers.robot @@ -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 index 0000000000..ee017a1d31 --- /dev/null +++ b/test/functional/cases/120_fuzzy/write-only.robot @@ -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 -- 2.47.3