aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/120_fuzzy
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-02-17 12:30:35 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-02-17 12:30:35 +0000
commit0ded9a29ce88ce9da1b41407f42e8bae207875a7 (patch)
tree2b040fdee7844bdd962643602e936dd0caacbea5 /test/functional/cases/120_fuzzy
parent20bd3eecb77562c115c9954e02eec8b4893fc25b (diff)
downloadrspamd-0ded9a29ce88ce9da1b41407f42e8bae207875a7.tar.gz
rspamd-0ded9a29ce88ce9da1b41407f42e8bae207875a7.zip
[Test] Add tests for dynamic fuzzy keys
Diffstat (limited to 'test/functional/cases/120_fuzzy')
-rw-r--r--test/functional/cases/120_fuzzy/encrypted.robot8
-rw-r--r--test/functional/cases/120_fuzzy/lib.robot16
2 files changed, 23 insertions, 1 deletions
diff --git a/test/functional/cases/120_fuzzy/encrypted.robot b/test/functional/cases/120_fuzzy/encrypted.robot
index 548ea8cb9..331fada2d 100644
--- a/test/functional/cases/120_fuzzy/encrypted.robot
+++ b/test/functional/cases/120_fuzzy/encrypted.robot
@@ -12,3 +12,11 @@ Fuzzy Fuzzy
Fuzzy Miss
Fuzzy Multimessage Miss Test
+
+Fuzzy Fuzzy Dynamic Key
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} "mbggdnw3tdx7r3ruakjecpf5hcqr4cb4nmdp1fxynx3drbyujb3y"
+ Fuzzy Multimessage Fuzzy Encrypted Test
+
+Fuzzy Fuzzy Another Dynamic Key
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} "c98d3pnb7ejjz1rkobumbbjzo5pbeh64rj68dudy8w7h8mipg1by"
+ Fuzzy Multimessage Fuzzy Encrypted Test
diff --git a/test/functional/cases/120_fuzzy/lib.robot b/test/functional/cases/120_fuzzy/lib.robot
index 02e0a0af5..bc0fdd51f 100644
--- a/test/functional/cases/120_fuzzy/lib.robot
+++ b/test/functional/cases/120_fuzzy/lib.robot
@@ -75,6 +75,15 @@ Fuzzy Fuzzy Test
Expect Symbol ${FLAG1_SYMBOL}
END
+Fuzzy Encrypted Test
+ [Arguments] ${message}
+ @{path_info} = Path Splitter ${message}
+ @{fuzzy_files} = List Files In Directory ${pathinfo}[0] pattern=${pathinfo}[1].fuzzy* absolute=1
+ FOR ${i} IN @{fuzzy_files}
+ ${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --key ${RSPAMD_FUZZY_ENCRYPTION_KEY} ${i}
+ Check Rspamc ${result} ${FLAG1_SYMBOL}
+ END
+
Fuzzy Miss Test
[Arguments] ${message}
Scan File ${message}
@@ -105,7 +114,7 @@ Fuzzy Setup Encrypted Keyed
[Arguments] ${algorithm}
Set Suite Variable ${RSPAMD_FUZZY_ALGORITHM} ${algorithm}
Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTED_ONLY} true
- Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} ${RSPAMD_KEY_PUB1}
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} ${RSPAMD_KEY_PUB1}
Set Suite Variable ${RSPAMD_FUZZY_KEY} mYN888sydwLTfE32g2hN
Set Suite Variable ${RSPAMD_FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
@@ -165,6 +174,11 @@ Fuzzy Multimessage Fuzzy Test
Fuzzy Fuzzy Test ${i}
END
+Fuzzy Multimessage Fuzzy Encrypted Test
+ FOR ${i} IN @{MESSAGES}
+ Fuzzy Encrypted Test ${i}
+ END
+
Fuzzy Multimessage Miss Test
FOR ${i} IN @{RANDOM_MESSAGES}
Fuzzy Miss Test ${i}