commit db4da2c: [Test] Use lupa for templating rspamd configs
Andrew Lewis
nerf at judo.za.org
Wed May 5 14:07:04 UTC 2021
Author: Andrew Lewis
Date: 2021-05-04 13:48:37 +0200
URL: https://github.com/rspamd/rspamd/commit/db4da2c22d159d1a6450b9447ad90e1795e5c535
[Test] Use lupa for templating rspamd configs
---
test/functional/cases/100_general.robot | 2 +-
test/functional/cases/101_lua.robot | 2 +-
test/functional/cases/102_multimap.robot | 6 +-
test/functional/cases/103_password.robot | 2 +-
test/functional/cases/104_get_from.robot | 6 +-
test/functional/cases/105_mimetypes.robot | 6 +-
test/functional/cases/106_mid.robot | 10 +-
test/functional/cases/108_settings.robot | 7 +-
test/functional/cases/109_composites.robot | 10 +-
test/functional/cases/110_statistics/lib.robot | 12 +-
.../cases/110_statistics/redis-keyed-siphash.robot | 7 +-
.../cases/110_statistics/redis-keyed-xxhash.robot | 7 +-
.../cases/110_statistics/redis-plain-siphash.robot | 5 +-
.../cases/110_statistics/redis-plain-xxhash.robot | 5 +-
test/functional/cases/114_phishing.robot | 6 +-
test/functional/cases/115_dmarc.robot | 6 +-
test/functional/cases/116_dkim.robot | 6 +-
test/functional/cases/117_spf.robot | 6 +-
test/functional/cases/120_fuzzy/lib.robot | 44 +++++---
test/functional/cases/121_json/100_preresult.robot | 2 +-
test/functional/cases/121_json/101_simple.robot | 2 +-
test/functional/cases/121_json/lib.robot | 3 +
test/functional/cases/123_whitelist.robot | 6 +-
test/functional/cases/125_map_reload.robot | 2 +-
.../cases/131_dkim_signing/001_simple.robot | 15 +--
.../cases/131_dkim_signing/002_redis.robot | 12 +-
.../cases/131_dkim_signing/003_eddsa.robot | 15 +--
.../131_dkim_signing/004_invalidate_key.robot | 6 +-
.../cases/131_dkim_signing/005_multiple.robot | 15 +--
.../cases/131_dkim_signing/006_milter.robot | 8 +-
.../cases/131_dkim_signing/007_sign_maps.robot | 15 +--
test/functional/cases/135_spamassassin.robot | 10 +-
test/functional/cases/140_proxy.robot | 36 +++---
test/functional/cases/160_antivirus.robot | 7 +-
test/functional/cases/161_p0f.robot | 7 +-
test/functional/cases/162_url_redirector.robot | 8 +-
test/functional/cases/180_milter.robot | 5 +-
test/functional/cases/220_http.robot | 7 +-
test/functional/cases/230_tcp.robot | 2 +-
test/functional/cases/231_tcp_down.robot | 7 +-
test/functional/cases/240_redis.robot | 17 +--
test/functional/cases/241_redis_is_dead.robot | 21 +---
test/functional/cases/250_dns.robot | 2 +-
test/functional/cases/260_regex.robot | 16 +--
test/functional/cases/270_selector.robot | 8 +-
test/functional/cases/280_rules.robot | 6 +-
test/functional/cases/281_fnames.robot | 17 +--
test/functional/cases/290_greylist.robot | 6 +-
test/functional/cases/300_rbl.robot | 6 +-
test/functional/cases/310_udp.robot | 7 +-
.../cases/320_arc_signing/001_simple.robot | 15 +--
.../cases/320_arc_signing/002_redis.robot | 12 +-
test/functional/cases/321_arc_check.robot | 6 +-
.../cases/330_neural/001_autotrain.robot | 10 +-
.../cases/330_neural/002_manualtrain.robot | 10 +-
test/functional/cases/340_surbl.robot | 6 +-
test/functional/cases/350_magic.robot | 115 ++++++++++----------
test/functional/cases/360_force_actions.robot | 6 +-
test/functional/configs/antivirus.conf | 12 +-
test/functional/configs/arc.conf | 4 +-
test/functional/configs/arc_signing/redis.conf | 4 +-
test/functional/configs/arc_signing/simple.conf | 4 +-
test/functional/configs/composites.conf | 16 +--
test/functional/configs/dkim.conf | 42 ++-----
test/functional/configs/dkim_signing/eddsa.conf | 4 +-
.../configs/dkim_signing/invalidate.conf | 4 +-
test/functional/configs/dkim_signing/milter.conf | 32 +++---
test/functional/configs/dkim_signing/multiple.conf | 6 +-
test/functional/configs/dkim_signing/redis.conf | 4 +-
.../functional/configs/dkim_signing/sign_maps.conf | 4 +-
test/functional/configs/dkim_signing/simple.conf | 4 +-
test/functional/configs/dmarc.conf | 6 +-
.../functional/configs/empty.conf | 0
test/functional/configs/force_actions.conf | 4 +-
test/functional/configs/fuzzy-encryption-key.conf | 2 +
test/functional/configs/fuzzy.conf | 55 ++++++----
test/functional/configs/greylist.conf | 4 +-
test/functional/configs/lua_script.conf | 14 +--
test/functional/configs/lua_test.conf | 18 +--
test/functional/configs/mid.conf | 6 +-
test/functional/configs/milter.conf | 26 ++---
test/functional/configs/mime_types.conf | 6 +-
test/functional/configs/multimap.conf | 48 ++++----
test/functional/configs/neural.conf | 22 ++--
test/functional/configs/neural_noauto.conf | 22 ++--
test/functional/configs/p0f.conf | 6 +-
test/functional/configs/password.conf | 26 ++---
test/functional/configs/phishing.conf | 6 +-
test/functional/configs/plugins.conf | 21 ++--
test/functional/configs/proxy.conf | 16 +--
test/functional/configs/rbl.conf | 4 +-
test/functional/configs/redis.conf | 6 +-
test/functional/configs/regexp.conf | 18 +--
test/functional/configs/selector.conf | 4 +-
test/functional/configs/settings.conf | 4 +-
test/functional/configs/spamassassin.conf | 8 +-
test/functional/configs/stats.conf | 34 +++---
test/functional/configs/surbl.conf | 6 +-
test/functional/configs/trivial.conf | 22 ++--
test/functional/configs/url_redirector.conf | 6 +-
test/functional/configs/whitelist.conf | 16 +--
test/functional/lib/rspamd.robot | 121 +++++++++++++++------
102 files changed, 639 insertions(+), 689 deletions(-)
diff --git a/test/functional/cases/100_general.robot b/test/functional/cases/100_general.robot
index 0a754a973..d2b3f24f5 100644
--- a/test/functional/cases/100_general.robot
+++ b/test/functional/cases/100_general.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup New Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
diff --git a/test/functional/cases/101_lua.robot b/test/functional/cases/101_lua.robot
index 215ecd086..034ce756f 100644
--- a/test/functional/cases/101_lua.robot
+++ b/test/functional/cases/101_lua.robot
@@ -73,7 +73,7 @@ Rule conditions
Lua Setup
[Arguments] ${LUA_SCRIPT}
Set Test Variable ${LUA_SCRIPT}
- Generic Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
Lua Replace Setup
[Arguments] ${LUA_SCRIPT_UNESC}
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index fc93d7565..7ab72c761 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/multimap.conf
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
${REDIS_SCOPE} Suite
@@ -338,10 +338,8 @@ MAP - MULTISYMBOL DISABLED
*** Keywords ***
Multimap Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Run Redis
+ New Setup REDIS_ADDR=${REDIS_ADDR} REDIS_PORT=${REDIS_PORT} URL_TLD=${URL_TLD}
Multimap Teardown
Normal Teardown
diff --git a/test/functional/cases/103_password.robot b/test/functional/cases/103_password.robot
index c750369bf..090bcaa6a 100644
--- a/test/functional/cases/103_password.robot
+++ b/test/functional/cases/103_password.robot
@@ -52,4 +52,4 @@ Password Setup
[Arguments] ${PASSWORD} ${ENABLE_PASSWORD}=nq2
Set Test Variable ${PASSWORD}
Set Test Variable ${ENABLE_PASSWORD}
- Generic Setup
+ New Setup PASSWORD=${PASSWORD} ENABLE_PASSWORD=${ENABLE_PASSWORD}
diff --git a/test/functional/cases/104_get_from.robot b/test/functional/cases/104_get_from.robot
index c15e0cdba..e1fcbc259 100644
--- a/test/functional/cases/104_get_from.robot
+++ b/test/functional/cases/104_get_from.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup GetFrom Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
@@ -51,3 +51,7 @@ task:get_from('mime') - quoted in the middle of DN (outer spaces)
task:get_from('mime') - quoted in the middle of DN (inner spaces)
Scan File ${TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
+
+*** Keywords ***
+GetFrom Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
diff --git a/test/functional/cases/105_mimetypes.robot b/test/functional/cases/105_mimetypes.robot
index a29ffcb6d..219846698 100644
--- a/test/functional/cases/105_mimetypes.robot
+++ b/test/functional/cases/105_mimetypes.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/mime_types.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
@@ -67,6 +67,4 @@ Empty text part should not be treat as html
*** Keywords ***
MIMETypes Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/mime_types.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
diff --git a/test/functional/cases/106_mid.robot b/test/functional/cases/106_mid.robot
index d220abc22..f014940ca 100644
--- a/test/functional/cases/106_mid.robot
+++ b/test/functional/cases/106_mid.robot
@@ -1,12 +1,12 @@
*** Settings ***
-Suite Setup MID Setup
+Suite Setup New Setup
Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/mid.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
@@ -34,9 +34,3 @@ MID - missing Message-ID allowed
Expect Symbol With Score MISSING_MID_ALLOWED 1.00
Do Not Expect Symbol MISSING_MID
Do Not Expect Symbol INVALID_MSGID
-
-*** Keywords ***
-MID Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/mid.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot
index 6e02e57a3..3409c84ff 100644
--- a/test/functional/cases/108_settings.robot
+++ b/test/functional/cases/108_settings.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/settings.conf
${LUA_SCRIPT} ${TESTDIR}/lua/settings.lua
${MESSAGE} ${TESTDIR}/messages/spam_message.eml
${MESSAGE_PRIORITY} ${TESTDIR}/messages/priority.eml
@@ -255,9 +255,8 @@ PRIORITY
Settings Setup
Copy File ${TESTDIR}/data/bayes.spam.sqlite3 /tmp/bayes.spam.sqlite3
Copy File ${TESTDIR}/data/bayes.ham.sqlite3 /tmp/bayes.ham.sqlite3
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/settings.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
Settings Teardown
Normal Teardown
+ Remove Files /tmp/bayes.spam.sqlite3 /tmp/bayes.ham.sqlite3
diff --git a/test/functional/cases/109_composites.robot b/test/functional/cases/109_composites.robot
index 3aeb009ed..8c93642dc 100644
--- a/test/functional/cases/109_composites.robot
+++ b/test/functional/cases/109_composites.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup Composites Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
@@ -66,7 +66,7 @@ Composites - Opts RE Hit
Do Not Expect Symbol SYMOPTS3
Composites - Opts RE Hit 2
- Scan File ${MESSAGE} opts=foo/,sym2
+ Scan File ${MESSAGE} opts=sym2,foo/
Expect Symbol With Score SYMOPTS3 6.00
Do Not Expect Symbol SYMOPTS2
Do Not Expect Symbol SYMOPTS1
@@ -75,4 +75,8 @@ Composites - Opts RE Hit 3
Scan File ${MESSAGE} opts=example.com->app.link
Expect Symbol With Score SYMOPTS4 6.00
Do Not Expect Symbol SYMOPTS2
- Do Not Expect Symbol SYMOPTS1
\ No newline at end of file
+ Do Not Expect Symbol SYMOPTS1
+
+*** Keywords ***
+Composites Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT}
diff --git a/test/functional/cases/110_statistics/lib.robot b/test/functional/cases/110_statistics/lib.robot
index 9dd313cd3..808580a11 100644
--- a/test/functional/cases/110_statistics/lib.robot
+++ b/test/functional/cases/110_statistics/lib.robot
@@ -8,10 +8,11 @@ ${CONFIG} ${TESTDIR}/configs/stats.conf
${MESSAGE_SPAM} ${TESTDIR}/messages/spam_message.eml
${MESSAGE_HAM} ${TESTDIR}/messages/ham.eml
${REDIS_SCOPE} Suite
-${REDIS_SERVER} ${EMPTY}
+${REDIS_SERVER} null
${RSPAMD_SCOPE} Suite
-${STATS_HASH} ${EMPTY}
-${STATS_KEY} ${EMPTY}
+${STATS_BACKEND} redis
+${STATS_HASH} null
+${STATS_KEY} null
*** Keywords ***
Broken Learn Test
@@ -46,11 +47,8 @@ Relearn Test
Do Not Expect Symbol BAYES_SPAM
Redis Statistics Setup
- ${tmpdir} = Make Temporary Directory
- Set Suite Variable ${TMPDIR} ${tmpdir}
Run Redis
- Generic Setup TMPDIR=${tmpdir}
+ New Setup STATS_BACKEND=${STATS_BACKEND} STATS_HASH=${STATS_HASH} STATS_KEY=${STATS_KEY} REDIS_SERVER=${REDIS_SERVER}
Redis Statistics Teardown
Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
diff --git a/test/functional/cases/110_statistics/redis-keyed-siphash.robot b/test/functional/cases/110_statistics/redis-keyed-siphash.robot
index 09d369d54..cc4320102 100644
--- a/test/functional/cases/110_statistics/redis-keyed-siphash.robot
+++ b/test/functional/cases/110_statistics/redis-keyed-siphash.robot
@@ -4,10 +4,9 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "siphash";
-${STATS_KEY} key = "${KEY_PVT1}";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} siphash
+${STATS_KEY} ${KEY_PVT1}
*** Test Cases ***
Learn
diff --git a/test/functional/cases/110_statistics/redis-keyed-xxhash.robot b/test/functional/cases/110_statistics/redis-keyed-xxhash.robot
index e95b4cebc..ba550df20 100644
--- a/test/functional/cases/110_statistics/redis-keyed-xxhash.robot
+++ b/test/functional/cases/110_statistics/redis-keyed-xxhash.robot
@@ -4,10 +4,9 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "xxhash";
-${STATS_KEY} key = "${KEY_PVT1}";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} xxhash
+${STATS_KEY} ${KEY_PVT1}
*** Test Cases ***
Learn
diff --git a/test/functional/cases/110_statistics/redis-plain-siphash.robot b/test/functional/cases/110_statistics/redis-plain-siphash.robot
index deb0c9559..10e28a26b 100644
--- a/test/functional/cases/110_statistics/redis-plain-siphash.robot
+++ b/test/functional/cases/110_statistics/redis-plain-siphash.robot
@@ -4,9 +4,8 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "siphash";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} siphash
*** Test Cases ***
Learn
diff --git a/test/functional/cases/110_statistics/redis-plain-xxhash.robot b/test/functional/cases/110_statistics/redis-plain-xxhash.robot
index 379f39767..47533d9be 100644
--- a/test/functional/cases/110_statistics/redis-plain-xxhash.robot
+++ b/test/functional/cases/110_statistics/redis-plain-xxhash.robot
@@ -4,9 +4,8 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
-${STATS_BACKEND} redis
-${STATS_HASH} hash = "xxhash";
+${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
+${STATS_HASH} xxhash
*** Test Cases ***
Learn
diff --git a/test/functional/cases/114_phishing.robot b/test/functional/cases/114_phishing.robot
index 67e6f9aca..d0c5cab78 100644
--- a/test/functional/cases/114_phishing.robot
+++ b/test/functional/cases/114_phishing.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/phishing.conf
${MESSAGE1} ${TESTDIR}/messages/phishing1.eml
${MESSAGE2} ${TESTDIR}/messages/phishing2.eml
${MESSAGE3} ${TESTDIR}/messages/phishing3.eml
@@ -28,6 +28,4 @@ TEST PHISHING STRICT TWO
*** Keywords ***
Phishing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/phishing.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
diff --git a/test/functional/cases/115_dmarc.robot b/test/functional/cases/115_dmarc.robot
index 120e4461c..4b3fe92da 100644
--- a/test/functional/cases/115_dmarc.robot
+++ b/test/functional/cases/115_dmarc.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
@@ -89,6 +89,4 @@ DMARC PCT ZERO SP QUARANTINE
*** Keywords ***
DMARC Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
diff --git a/test/functional/cases/116_dkim.robot b/test/functional/cases/116_dkim.robot
index 45f5ad314..f1a906569 100644
--- a/test/functional/cases/116_dkim.robot
+++ b/test/functional/cases/116_dkim.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
@@ -54,6 +54,4 @@ DKIM Verify ED25519 REJECT
*** Keywords ***
DKIM Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
diff --git a/test/functional/cases/117_spf.robot b/test/functional/cases/117_spf.robot
index 245c9c593..210efd42a 100644
--- a/test/functional/cases/117_spf.robot
+++ b/test/functional/cases/117_spf.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
@@ -138,6 +138,4 @@ SPF UPPERCASE
*** Keywords ***
SPF Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup URL_TLD=${URL_TLD}
diff --git a/test/functional/cases/120_fuzzy/lib.robot b/test/functional/cases/120_fuzzy/lib.robot
index ca6143253..6af0245d2 100644
--- a/test/functional/cases/120_fuzzy/lib.robot
+++ b/test/functional/cases/120_fuzzy/lib.robot
@@ -11,6 +11,11 @@ ${FLAG1_NUMBER} 50
${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED
${FLAG2_NUMBER} 51
${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE
+${FUZZY_ENCRYPTED_ONLY} false
+${FUZZY_ENCRYPTION_KEY} null
+${FUZZY_KEY} null
+${FUZZY_INCLUDE} ${TESTDIR}/configs/empty.conf
+${FUZZY_SHINGLES_KEY} null
@{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
@@ -86,34 +91,41 @@ Fuzzy Overwrite Test
Fuzzy Setup Encrypted
[Arguments] ${algorithm}
- ${worker_settings} = Set Variable "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true;
- ${check_settings} = Set Variable encryption_key = "${KEY_PUB1}";
- Fuzzy Setup Generic ${algorithm} ${worker_settings} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
+ Set Suite Variable ${FUZZY_INCLUDE} ${TESTDIR}/configs/fuzzy-encryption-key.conf
+ Fuzzy Setup Generic
Fuzzy Setup Encrypted Keyed
[Arguments] ${algorithm}
- ${worker_settings} = Set Variable "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true;
- ${check_settings} = Set Variable fuzzy_key = "mYN888sydwLTfE32g2hN"; fuzzy_shingles_key = "hXUCgul9yYY3Zlk1QIT2"; encryption_key = "${KEY_PUB1}";
- Fuzzy Setup Generic ${algorithm} ${worker_settings} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
+
+ Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Fuzzy Setup Generic
Fuzzy Setup Plain
[Arguments] ${algorithm}
- Fuzzy Setup Generic ${algorithm} ${EMPTY} ${EMPTY}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Fuzzy Setup Generic
Fuzzy Setup Keyed
[Arguments] ${algorithm}
- ${check_settings} = Set Variable fuzzy_key = "mYN888sydwLTfE32g2hN"; fuzzy_shingles_key = "hXUCgul9yYY3Zlk1QIT2";
- Fuzzy Setup Generic ${algorithm} ${EMPTY} ${check_settings}
+ Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Fuzzy Setup Generic
Fuzzy Setup Generic
- [Arguments] ${algorithm} ${worker_settings} ${check_settings} &{kwargs}
- ${worker_settings} = Set Variable backend \= "redis"; ${worker_settings}
- ${tmpdir} = Make Temporary Directory
- Set Suite Variable ${TMPDIR} ${tmpdir}
- Set Suite Variable ${SETTINGS_FUZZY_WORKER} ${worker_settings}
- Set Suite Variable ${SETTINGS_FUZZY_CHECK} ${check_settings}
Run Redis
- Generic Setup TMPDIR=${TMPDIR}
+ Generic Setup FUZZY_ALGORITHM=${FUZZY_ALGORITHM} FUZZY_ENCRYPTED_ONLY=${FUZZY_ENCRYPTED_ONLY}
+ ... FUZZY_KEY=${FUZZY_KEY} FUZZY_SHINGLES_KEY=${FUZZY_SHINGLES_KEY}
+ ... FUZZY_ENCRYPTION_KEY=${FUZZY_ENCRYPTION_KEY} FLAG1_NUMBER=${FLAG1_NUMBER}
+ ... FLAG2_NUMBER=${FLAG2_NUMBER} FUZZY_BACKEND=redis PORT_FUZZY=${PORT_FUZZY}
+ ... FUZZY_INCLUDE=${FUZZY_INCLUDE}
Fuzzy Setup Plain Fasthash
Fuzzy Setup Plain fasthash
diff --git a/test/functional/cases/121_json/100_preresult.robot b/test/functional/cases/121_json/100_preresult.robot
index aa25c0272..5122ae117 100644
--- a/test/functional/cases/121_json/100_preresult.robot
+++ b/test/functional/cases/121_json/100_preresult.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup JSON Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource lib.robot
diff --git a/test/functional/cases/121_json/101_simple.robot b/test/functional/cases/121_json/101_simple.robot
index da5aa0f19..1c548ebe5 100644
--- a/test/functional/cases/121_json/101_simple.robot
+++ b/test/functional/cases/121_json/101_simple.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Suite Setup Generic Setup
+Suite Setup JSON Setup
Suite Teardown Simple Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource lib.robot
diff --git a/test/functional/cases/121_json/lib.robot b/test/functional/cases/121_json/lib.robot
index 4d87485dc..b1ec0ac18 100644
--- a/test/functional/cases/121_json/lib.robot
+++ b/test/functional/cases/121_json/lib.robot
@@ -2,6 +2,9 @@
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
+JSON Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+
Stat Test
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /stat
Check JSON ${result}[1]
diff --git a/test/functional/cases/123_whitelist.robot b/test/functional/cases/123_whitelist.robot
index 6482793a3..675178774 100644
--- a/test/functional/cases/123_whitelist.robot
+++ b/test/functional/cases/123_whitelist.robot
@@ -6,7 +6,7 @@ Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/whitelist.conf
${M_DMARC_OK} ${TESTDIR}/messages/dmarc/pass_none.eml
${M_DMARC_BAD} ${TESTDIR}/messages/dmarc/fail_none.eml
@@ -79,6 +79,4 @@ VALID SPF and NO DKIM
*** Keywords ***
Whitelist Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/whitelist.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
+ New Setup
diff --git a/test/functional/cases/125_map_reload.robot b/test/functional/cases/125_map_reload.robot
index be7e0a722..33ca264b5 100644
--- a/test/functional/cases/125_map_reload.robot
+++ b/test/functional/cases/125_map_reload.robot
@@ -39,7 +39,7 @@ Map Reload Setup
${lua} = Replace Variables ${lua}
Create File ${LUA_SCRIPT} ${lua}
Create File ${MAP_FILE} ${MAP1}
- Generic Setup
+ New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
Map Reload Teardown
Remove File ${MAP_FILE}
diff --git a/test/functional/cases/131_dkim_signing/001_simple.robot b/test/functional/cases/131_dkim_signing/001_simple.robot
index 2bcd53f36..6185ec2e4 100644
--- a/test/functional/cases/131_dkim_signing/001_simple.robot
+++ b/test/functional/cases/131_dkim_signing/001_simple.robot
@@ -1,12 +1,12 @@
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/simple.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
@@ -33,12 +33,3 @@ TEST NOT SIGNED - USERNAME WRONG PUBKEY
${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob at invalid.za.org
Check Rspamc ${result} DKIM-Signature: inverse=1
Should Not Contain ${result.stdout} DKIM_SIGNED
-
-*** Keywords ***
-DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/simple.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
-
-DKIM Signing Teardown
- Normal Teardown
diff --git a/test/functional/cases/131_dkim_signing/002_redis.robot b/test/functional/cases/131_dkim_signing/002_redis.robot
index e87749a0a..45611c2bc 100644
--- a/test/functional/cases/131_dkim_signing/002_redis.robot
+++ b/test/functional/cases/131_dkim_signing/002_redis.robot
@@ -1,12 +1,12 @@
*** Settings ***
Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Teardown Normal Teardown
Library ${TESTDIR}/lib/rspamd.py
Resource ${TESTDIR}/lib/rspamd.robot
Variables ${TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/plugins.conf
+${CONFIG} ${TESTDIR}/configs/dkim_signing/redis.conf
${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
@@ -25,14 +25,8 @@ TEST NOT SIGNED - USERNAME WRONG DOMAIN
*** Keywords ***
DKIM Signing Setup
- ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/redis.conf
- Set Suite Variable ${PLUGIN_CONFIG}
- Generic Setup PLUGIN_CONFIG
Run Redis
Redis HSET TEST_DKIM_SELECTORS cacophony.za.org dkim
${key} = Get File ${TESTDIR}/configs/dkim.key
Redis HSET TEST_DKIM_KEYS dkim.cacophony.za.org ${key}
-
-DKIM Signing Teardown
- Normal Teardown
- Shutdown Process With Children ${REDIS_PID}
+ New Setup
diff --git a/test/functional/cases/131_dkim_signing/003_eddsa.robot b/test/functional/cases/131_dkim_signing/003_eddsa.robot
index ea2fe03be..37c01893d 100644
--- a/test/functional/cases/131_dkim_signing/003_eddsa.robot
+++ b/test/functional/cases/131_dkim_signing/003_eddsa.robot
@@ -1,12 +1,12 @@
*** Settings ***
-Suite Setup DKIM Signing Setup
-Suite Teardown DKIM Signing Teardown
+Suite Setup New Setup
*** OUTPUT TRUNCATED, 2835 LINES SKIPPED ***
More information about the Commits
mailing list