From 0ded9a29ce88ce9da1b41407f42e8bae207875a7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 17 Feb 2024 12:30:35 +0000 Subject: [Test] Add tests for dynamic fuzzy keys --- test/functional/cases/120_fuzzy/encrypted.robot | 8 ++++++++ test/functional/cases/120_fuzzy/lib.robot | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'test/functional/cases/120_fuzzy') 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} -- cgit v1.2.3