commit a84ceca: [Test] Use automatically exported variables

Andrew Lewis nerf at judo.za.org
Wed May 5 14:07:06 UTC 2021


Author: Andrew Lewis
Date: 2021-05-04 21:43:55 +0200
URL: https://github.com/rspamd/rspamd/commit/a84cecac6bef1211cf8ab245d997b6ac64b6686a

[Test] Use automatically exported variables

---
 test/functional/cases/100_general.robot            | 22 ++---
 test/functional/cases/101_lua.robot                | 58 ++++++-------
 test/functional/cases/102_multimap.robot           | 38 ++++-----
 test/functional/cases/103_password.robot           | 48 +++++------
 test/functional/cases/104_get_from.robot           | 30 +++----
 test/functional/cases/105_mimetypes.robot          | 36 ++++----
 test/functional/cases/106_mid.robot                | 18 ++--
 test/functional/cases/108_settings.robot           | 32 +++----
 test/functional/cases/109_composites.robot         | 14 +--
 test/functional/cases/110_statistics/lib.robot     | 34 ++++----
 .../cases/110_statistics/redis-keyed-siphash.robot |  6 +-
 .../cases/110_statistics/redis-keyed-xxhash.robot  |  6 +-
 .../cases/110_statistics/redis-plain-siphash.robot |  4 +-
 .../cases/110_statistics/redis-plain-xxhash.robot  |  4 +-
 test/functional/cases/114_phishing.robot           | 18 ++--
 test/functional/cases/115_dmarc.robot              | 46 +++++-----
 test/functional/cases/116_dkim.robot               | 26 +++---
 test/functional/cases/117_spf.robot                | 54 ++++++------
 test/functional/cases/120_fuzzy/lib.robot          | 79 +++++++++--------
 test/functional/cases/121_json/100_preresult.robot | 12 +--
 test/functional/cases/121_json/101_simple.robot    | 12 +--
 test/functional/cases/121_json/lib.robot           | 10 +--
 test/functional/cases/123_whitelist.robot          | 22 ++---
 test/functional/cases/125_map_reload.robot         | 28 +++---
 .../cases/131_dkim_signing/001_simple.robot        | 14 +--
 .../cases/131_dkim_signing/002_redis.robot         | 14 +--
 .../cases/131_dkim_signing/003_eddsa.robot         | 14 +--
 .../131_dkim_signing/004_invalidate_key.robot      | 24 +++---
 .../cases/131_dkim_signing/005_multiple.robot      | 14 +--
 .../cases/131_dkim_signing/006_milter.robot        | 14 +--
 .../cases/131_dkim_signing/007_sign_maps.robot     | 14 +--
 test/functional/cases/135_spamassassin.robot       | 16 ++--
 test/functional/cases/140_proxy.robot              | 32 +++----
 test/functional/cases/150_rspamadm.robot           |  4 +-
 test/functional/cases/151_rspamadm_async.robot     | 20 ++---
 test/functional/cases/160_antivirus.robot          | 37 ++++----
 test/functional/cases/161_p0f.robot                | 30 +++----
 test/functional/cases/162_url_redirector.robot     | 22 ++---
 test/functional/cases/180_milter.robot             | 16 ++--
 .../cases/210_clickhouse/001_migration.robot       | 52 ++++++------
 test/functional/cases/220_http.robot               | 20 ++---
 test/functional/cases/230_tcp.robot                | 25 +++---
 test/functional/cases/231_tcp_down.robot           | 24 ++----
 test/functional/cases/240_redis.robot              | 15 ++--
 test/functional/cases/241_redis_is_dead.robot      | 19 ++---
 test/functional/cases/250_dns.robot                | 29 ++-----
 test/functional/cases/260_regex.robot              | 14 +--
 test/functional/cases/270_selector.robot           | 16 ++--
 test/functional/cases/280_rules.robot              | 56 ++++++------
 test/functional/cases/281_fnames.robot             | 20 ++---
 test/functional/cases/290_greylist.robot           | 14 +--
 test/functional/cases/300_rbl.robot                | 26 +++---
 test/functional/cases/310_udp.robot                | 17 ++--
 .../cases/320_arc_signing/001_simple.robot         | 14 +--
 .../cases/320_arc_signing/002_redis.robot          | 14 +--
 test/functional/cases/321_arc_check.robot          | 16 ++--
 .../cases/330_neural/001_autotrain.robot           | 14 +--
 .../cases/330_neural/002_manualtrain.robot         | 22 ++---
 test/functional/cases/340_surbl.robot              | 60 ++++++-------
 test/functional/cases/350_magic.robot              | 16 ++--
 test/functional/cases/360_force_actions.robot      | 12 +--
 test/functional/cases/__init__.robot               |  8 +-
 test/functional/configs/clickhouse-config.xml      |  8 +-
 test/functional/configs/clickhouse.conf            | 14 +--
 test/functional/configs/fuzzy_master_worker.conf   |  2 +-
 test/functional/configs/fuzzy_slave_worker.conf    |  2 +-
 test/functional/configs/nginx.conf                 |  6 +-
 test/functional/configs/pluginsplus.conf           | 14 +--
 test/functional/configs/redis-server.conf          | 10 +--
 test/functional/configs/url_tags.conf              |  2 +-
 test/functional/lib/rspamd.py                      | 10 +--
 test/functional/lib/rspamd.robot                   | 99 ++++++++++------------
 test/functional/lib/vars.py                        | 40 ++++-----
 73 files changed, 817 insertions(+), 855 deletions(-)

diff --git a/test/functional/cases/100_general.robot b/test/functional/cases/100_general.robot
index d2b3f24f5..c7ce01d97 100644
--- a/test/functional/cases/100_general.robot
+++ b/test/functional/cases/100_general.robot
@@ -1,15 +1,15 @@
 *** Settings ***
 Suite Setup     New Setup
 Suite Teardown  Simple Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/trivial.conf
-${GTUBE}        ${TESTDIR}/messages/gtube.eml
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/trivial.conf
+${GTUBE}        ${RSPAMD_TESTDIR}/messages/gtube.eml
 ${RSPAMD_SCOPE}  Suite
-${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD}      ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
 GTUBE
@@ -17,7 +17,7 @@ GTUBE
   Expect Symbol  GTUBE
 
 GTUBE - Encrypted
-  ${result} =  Run Rspamc  -p  -h  ${LOCAL_ADDR}:${PORT_NORMAL}  --key  ${KEY_PUB1}
+  ${result} =  Run Rspamc  -p  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL}  --key  ${RSPAMD_KEY_PUB1}
   ...  ${GTUBE}
   Check Rspamc  ${result}  GTUBE (
 
@@ -31,20 +31,20 @@ GTUBE - Scan File feature (encoded)
   Expect Symbol  GTUBE
 
 GTUBE - SPAMC
-  ${result} =  Spamc  ${LOCAL_ADDR}  ${PORT_NORMAL}  ${GTUBE}
+  ${result} =  Spamc  ${RSPAMD_LOCAL_ADDR}  ${RSPAMD_PORT_NORMAL}  ${GTUBE}
   Should Contain  ${result}  GTUBE
 
 GTUBE - RSPAMC
-  ${result} =  Rspamc  ${LOCAL_ADDR}  ${PORT_NORMAL}  ${GTUBE}
+  ${result} =  Rspamc  ${RSPAMD_LOCAL_ADDR}  ${RSPAMD_PORT_NORMAL}  ${GTUBE}
   Should Contain  ${result}  GTUBE
 
 EMAILS DETECTION 1
-  Scan File  ${TESTDIR}/messages/emails1.eml  URL-Format=Extended
+  Scan File  ${RSPAMD_TESTDIR}/messages/emails1.eml  URL-Format=Extended
   Expect Email  jim at example.net
   Expect Email  bob at example.net
   Expect Email  rupert at example.net
 
 EMAILS DETECTION ZEROFONT
-  Scan File  ${TESTDIR}/messages/zerofont.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/zerofont.eml
   Expect Symbol  MANY_INVISIBLE_PARTS
   Expect Symbol  ZERO_FONT
diff --git a/test/functional/cases/101_lua.robot b/test/functional/cases/101_lua.robot
index 034ce756f..168f0e8bb 100644
--- a/test/functional/cases/101_lua.robot
+++ b/test/functional/cases/101_lua.robot
@@ -1,53 +1,53 @@
 *** Settings ***
 Test Teardown   Normal Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/lua_test.conf
-${MAP_MAP}      ${TESTDIR}/configs/maps/map.list
-${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
-${RADIX_MAP}    ${TESTDIR}/configs/maps/ip2.list
-${REGEXP_MAP}   ${TESTDIR}/configs/maps/regexp.list
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MAP_MAP}      ${RSPAMD_TESTDIR}/configs/maps/map.list
+${MESSAGE}      ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RADIX_MAP}    ${RSPAMD_TESTDIR}/configs/maps/ip2.list
+${REGEXP_MAP}   ${RSPAMD_TESTDIR}/configs/maps/regexp.list
 ${RSPAMD_SCOPE}  Test
-${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD}      ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
 Flags
-  [Setup]  Lua Setup  ${TESTDIR}/lua/flags.lua
+  [Setup]  Lua Setup  ${RSPAMD_TESTDIR}/lua/flags.lua
   Scan File  ${MESSAGE}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  stat
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  stat
   Should Contain  ${result.stdout}  Messages scanned: 0
 
 Dependencies
-  [Setup]  Lua Setup  ${TESTDIR}/lua/deps.lua
+  [Setup]  Lua Setup  ${RSPAMD_TESTDIR}/lua/deps.lua
   Scan File  ${MESSAGE}
   Expect Symbol  DEP10
 
 Pre and Post Filters
-  [Setup]  Lua Setup  ${TESTDIR}/lua/prepostfilters.lua
+  [Setup]  Lua Setup  ${RSPAMD_TESTDIR}/lua/prepostfilters.lua
   Scan File  ${MESSAGE}
   Expect Symbol  TEST_PRE
   Expect Symbol  TEST_POST
 
 Recipient Parsing Sanity
-  [Setup]  Lua Setup  ${TESTDIR}/lua/recipients.lua
+  [Setup]  Lua Setup  ${RSPAMD_TESTDIR}/lua/recipients.lua
   Scan File  ${MESSAGE}  Rcpt=rcpt1 at foobar,rcpt2 at foobar,rcpt3 at foobar,rcpt4 at foobar
   Expect Symbol With Exact Options  TEST_RCPT  rcpt1 at foobar,rcpt2 at foobar,rcpt3 at foobar,rcpt4 at foobar
 
 TLD parts
-  [Setup]  TLD Setup  ${TESTDIR}/lua/tlds.lua
+  [Setup]  TLD Setup  ${RSPAMD_TESTDIR}/lua/tlds.lua
   Scan File  ${MESSAGE}
   Expect Symbol With Exact Options  TEST_TLD  no worry
 
 Hashes
-  [Setup]  Lua Setup  ${TESTDIR}/lua/hashes.lua
+  [Setup]  Lua Setup  ${RSPAMD_TESTDIR}/lua/hashes.lua
   Scan File  ${MESSAGE}
   Expect Symbol With Exact Options  TEST_HASHES  no worry
 
 Maps Key Values
-  [Setup]  Lua Replace Setup  ${TESTDIR}/lua/maps_kv.lua
+  [Setup]  Lua Replace Setup  ${RSPAMD_TESTDIR}/lua/maps_kv.lua
   [Teardown]  Lua Replace Teardown
   Scan File  ${MESSAGE}
   Expect Symbol With Exact Options  RADIX_KV  no worry
@@ -55,14 +55,14 @@ Maps Key Values
   Expect Symbol With Exact Options  MAP_KV  no worry
 
 Option Order
-  [Setup]  Lua Replace Setup  ${TESTDIR}/lua/option_order.lua
+  [Setup]  Lua Replace Setup  ${RSPAMD_TESTDIR}/lua/option_order.lua
   [Teardown]  Lua Replace Teardown
   Scan File  ${MESSAGE}
   Expect Symbol With Exact Options  OPTION_ORDER  one  two  three  4  5  a
   Expect Symbol With Exact Options  TBL_OPTION_ORDER  one  two  three  4  5  a
 
 Rule conditions
-  [Setup]  Lua Replace Setup  ${TESTDIR}/lua/conditions.lua
+  [Setup]  Lua Replace Setup  ${RSPAMD_TESTDIR}/lua/conditions.lua
   [Teardown]  Lua Replace Teardown
   Scan File  ${MESSAGE}
   Expect Symbol With Option  ANY_A  hello3
@@ -71,23 +71,23 @@ Rule conditions
 
 *** Keywords ***
 Lua Setup
-  [Arguments]  ${LUA_SCRIPT}
-  Set Test Variable  ${LUA_SCRIPT}
-  New Setup  LUA_SCRIPT=${LUA_SCRIPT}  URL_TLD=${URL_TLD}
+  [Arguments]  ${RSPAMD_LUA_SCRIPT}
+  Set Test Variable  ${RSPAMD_LUA_SCRIPT}
+  New Setup
 
 Lua Replace Setup
   [Arguments]  ${LUA_SCRIPT_UNESC}
-  ${LUA_SCRIPT} =  Make Temporary File
+  ${RSPAMD_LUA_SCRIPT} =  Make Temporary File
   ${lua} =  Get File  ${LUA_SCRIPT_UNESC}
   ${lua} =  Replace Variables  ${lua}
-  Create File  ${LUA_SCRIPT}  ${lua}
-  Lua Setup  ${LUA_SCRIPT}
+  Create File  ${RSPAMD_LUA_SCRIPT}  ${lua}
+  Lua Setup  ${RSPAMD_LUA_SCRIPT}
 
 Lua Replace Teardown
-  Remove File  ${LUA_SCRIPT}
+  Remove File  ${RSPAMD_LUA_SCRIPT}
   Normal Teardown
 
 TLD Setup
-  [Arguments]  ${LUA_SCRIPT}
-  Set Test Variable  ${URL_TLD}  ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
-  Lua Setup  ${LUA_SCRIPT}
+  [Arguments]  ${RSPAMD_LUA_SCRIPT}
+  Set Test Variable  ${RSPAMD_URL_TLD}  ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+  Lua Setup  ${RSPAMD_LUA_SCRIPT}
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index 7ab72c761..679a4c183 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -1,28 +1,28 @@
 *** Settings ***
 Suite Setup     Multimap Setup
 Suite Teardown  Multimap Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/multimap.conf
-${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
-${UTF_MESSAGE}  ${TESTDIR}/messages/utf.eml
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/multimap.conf
+${MESSAGE}      ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${UTF_MESSAGE}  ${RSPAMD_TESTDIR}/messages/utf.eml
 ${REDIS_SCOPE}  Suite
 ${RSPAMD_SCOPE}  Suite
-${RCVD1}        ${TESTDIR}/messages/received1.eml
-${RCVD2}        ${TESTDIR}/messages/received2.eml
-${RCVD3}        ${TESTDIR}/messages/received3.eml
-${RCVD4}        ${TESTDIR}/messages/received4.eml
-${URL1}         ${TESTDIR}/messages/url1.eml
-${URL2}         ${TESTDIR}/messages/url2.eml
-${URL3}         ${TESTDIR}/messages/url3.eml
-${URL4}         ${TESTDIR}/messages/url4.eml
-${URL5}         ${TESTDIR}/messages/url5.eml
-${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
-${FREEMAIL_CC}  ${TESTDIR}/messages/freemailcc.eml
-${URL_ICS}      ${TESTDIR}/messages/ics.eml
+${RCVD1}        ${RSPAMD_TESTDIR}/messages/received1.eml
+${RCVD2}        ${RSPAMD_TESTDIR}/messages/received2.eml
+${RCVD3}        ${RSPAMD_TESTDIR}/messages/received3.eml
+${RCVD4}        ${RSPAMD_TESTDIR}/messages/received4.eml
+${RSPAMD_URL_TLD}      ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${URL1}         ${RSPAMD_TESTDIR}/messages/url1.eml
+${URL2}         ${RSPAMD_TESTDIR}/messages/url2.eml
+${URL3}         ${RSPAMD_TESTDIR}/messages/url3.eml
+${URL4}         ${RSPAMD_TESTDIR}/messages/url4.eml
+${URL5}         ${RSPAMD_TESTDIR}/messages/url5.eml
+${FREEMAIL_CC}  ${RSPAMD_TESTDIR}/messages/freemailcc.eml
+${URL_ICS}      ${RSPAMD_TESTDIR}/messages/ics.eml
 
 *** Test Cases ***
 URL_ICS
@@ -339,7 +339,7 @@ MAP - MULTISYMBOL DISABLED
 *** Keywords ***
 Multimap Setup
   Run Redis
-  New Setup  REDIS_ADDR=${REDIS_ADDR}  REDIS_PORT=${REDIS_PORT}  URL_TLD=${URL_TLD}
+  New Setup
 
 Multimap Teardown
   Normal Teardown
diff --git a/test/functional/cases/103_password.robot b/test/functional/cases/103_password.robot
index 090bcaa6a..e40255211 100644
--- a/test/functional/cases/103_password.robot
+++ b/test/functional/cases/103_password.robot
@@ -1,55 +1,55 @@
 *** Settings ***
 Test Teardown   Normal Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/password.conf
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/password.conf
 ${CONTROLLER_ERRORS}  False
 ${RSPAMD_SCOPE}  Test
-${PBKDF_PASSWORD}  "$1$rhzzahtm8a5homdhh7z4qiiy7j8pzp4u$k5toro136brshjjuy9t39r785td69qodmd39qzygxuyehn9tqauy"
-${CATENA_PASSWORD}  "$2$xu1581gidj5cyp4yjgo68qbj6jz1j8o3$j9yg4k58jy3fj8suijxx9d7pea6a6obtufq9kfenosyq8erm87ky"
+${RSPAMD_PBKDF_PASSWORD}  "$1$rhzzahtm8a5homdhh7z4qiiy7j8pzp4u$k5toro136brshjjuy9t39r785td69qodmd39qzygxuyehn9tqauy"
+${RSPAMD_CATENA_PASSWORD}  "$2$xu1581gidj5cyp4yjgo68qbj6jz1j8o3$j9yg4k58jy3fj8suijxx9d7pea6a6obtufq9kfenosyq8erm87ky"
 
 *** Test Cases ***
 PASSWORD - PBKDF
-  [Setup]  Password Setup  ${PBKDF_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  nq1  stat
+  [Setup]  Password Setup  ${RSPAMD_PBKDF_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  nq1  stat
   Check Rspamc  ${result}  Messages scanned:
 
 PASSWORD - PBKDF WRONG
-  [Setup]  Password Setup  ${PBKDF_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  q1q1  stat
+  [Setup]  Password Setup  ${RSPAMD_PBKDF_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  q1q1  stat
   Should Be Equal As Integers  ${result.rc}  1
 
 PASSWORD - CATENA
-  [Setup]  Password Setup  ${CATENA_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  nq1  stat
+  [Setup]  Password Setup  ${RSPAMD_CATENA_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  nq1  stat
   Check Rspamc  ${result}  Messages scanned:
 
 PASSWORD - CATENA WRONG
-  [Setup]  Password Setup  ${CATENA_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  q  stat
+  [Setup]  Password Setup  ${RSPAMD_CATENA_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  q  stat
   Should Be Equal As Integers  ${result.rc}  1
 
 PASSWORD - ENABLE
-  [Setup]  Password Setup  ${CATENA_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  nq2  stat_reset
+  [Setup]  Password Setup  ${RSPAMD_CATENA_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  nq2  stat_reset
   Check Rspamc  ${result}  Messages scanned:
 
 PASSWORD - ENABLE WITH NORMAL
-  [Setup]  Password Setup  ${CATENA_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  nq1  stat_reset
+  [Setup]  Password Setup  ${RSPAMD_CATENA_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  nq1  stat_reset
   Should Be Equal As Integers  ${result.rc}  1
 
 PASSWORD - ENABLE INCORRECT
-  [Setup]  Password Setup  ${CATENA_PASSWORD}
-  ${result} =  Run Rspamc  -h  ${LOCAL_ADDR}:${PORT_CONTROLLER}  -P  q2q2  stat_reset
+  [Setup]  Password Setup  ${RSPAMD_CATENA_PASSWORD}
+  ${result} =  Run Rspamc  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}  -P  q2q2  stat_reset
   Should Be Equal As Integers  ${result.rc}  1
 
 *** Keywords ***
 Password Setup
-  [Arguments]  ${PASSWORD}  ${ENABLE_PASSWORD}=nq2
-  Set Test Variable  ${PASSWORD}
-  Set Test Variable  ${ENABLE_PASSWORD}
-  New Setup  PASSWORD=${PASSWORD}  ENABLE_PASSWORD=${ENABLE_PASSWORD}
+  [Arguments]  ${RSPAMD_PASSWORD}  ${RSPAMD_ENABLE_PASSWORD}=nq2
+  Set Test Variable  ${RSPAMD_PASSWORD}
+  Set Test Variable  ${RSPAMD_ENABLE_PASSWORD}
+  New Setup
diff --git a/test/functional/cases/104_get_from.robot b/test/functional/cases/104_get_from.robot
index e1fcbc259..a217df443 100644
--- a/test/functional/cases/104_get_from.robot
+++ b/test/functional/cases/104_get_from.robot
@@ -1,13 +1,13 @@
 *** Settings ***
 Suite Setup     GetFrom Setup
 Suite Teardown  Simple Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}        ${TESTDIR}/configs/lua_script.conf
-${LUA_SCRIPT}    ${TESTDIR}/lua/get_from.lua
+${CONFIG}        ${RSPAMD_TESTDIR}/configs/lua_script.conf
+${RSPAMD_LUA_SCRIPT}    ${RSPAMD_TESTDIR}/lua/get_from.lua
 ${RSPAMD_SCOPE}  Suite
 
 ${SYMBOL}   GET_FROM
@@ -17,41 +17,41 @@ ${OPTIONS3}  First M. Last,user at example.org,user,example.org
 
 *** Test Cases ***
 task:get_from('mime') - address only
-  Scan File  ${TESTDIR}/messages/from/from.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from.eml
   Expect Symbol  ${SYMBOL}
 
 task:get_from('mime') - comment
-  Scan File  ${TESTDIR}/messages/from/from_comment.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_comment.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS1}
 
 task:get_from('mime') - display name
-  Scan File  ${TESTDIR}/messages/from/from_dn.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS2}
 
 task:get_from('mime') - display name Base64
-  Scan File  ${TESTDIR}/messages/from/from_dn_base64.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn_base64.eml
   Expect Symbol With Exact Options  ${SYMBOL}  Кириллица,user at example.org,user,example.org
 
 task:get_from('mime') - display name and comment
-  Scan File  ${TESTDIR}/messages/from/from_dn_comment.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn_comment.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS2}
 
 task:get_from('mime') - quoted display name
-  Scan File  ${TESTDIR}/messages/from/from_quoted_dn.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted display name and comment
-  Scan File  ${TESTDIR}/messages/from/from_quoted_dn_comment.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_comment.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted in the middle of DN (outer spaces)
-  Scan File  ${TESTDIR}/messages/from/from_quoted_dn_middle.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle.eml
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted in the middle of DN (inner spaces)
-  Scan File  ${TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
+  Scan File  ${RSPAMD_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}
+  New Setup
diff --git a/test/functional/cases/105_mimetypes.robot b/test/functional/cases/105_mimetypes.robot
index 219846698..d27fd19f0 100644
--- a/test/functional/cases/105_mimetypes.robot
+++ b/test/functional/cases/105_mimetypes.robot
@@ -1,70 +1,70 @@
 *** Settings ***
 Suite Setup     MIMETypes Setup
 Suite Teardown  Simple Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/mime_types.conf
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/mime_types.conf
 ${RSPAMD_SCOPE}  Suite
-${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD}      ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
 Zip
-  Scan File  ${TESTDIR}/messages/zip.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/zip.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  exe
 
 Zip Double Bad Extension
-  Scan File  ${TESTDIR}/messages/zip-doublebad.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/zip-doublebad.eml
   Expect Symbol With Exact Options  MIME_DOUBLE_BAD_EXTENSION  .pdf.exe
 
 Next-to-last Double Bad Extension
-  Scan File  ${TESTDIR}/messages/next2last-doublebad.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/next2last-doublebad.eml
   Expect Symbol With Exact Options  MIME_DOUBLE_BAD_EXTENSION  .scr.xz
 
 Date is followed by Bad Extension
-  Scan File  ${TESTDIR}/messages/rar-date-bad-ext.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/rar-date-bad-ext.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  scr
   Do Not Expect Symbol  MIME_DOUBLE_BAD_EXTENSION
 
 Dotted file name is followed by Bad Extension
-  Scan File  ${TESTDIR}/messages/bad_ext.dotted_file_name.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/bad_ext.dotted_file_name.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  exe
   Do Not Expect Symbol  MIME_DOUBLE_BAD_EXTENSION
 
 Dotted numbers in parentheses is followed by Bad Extension
-  Scan File  ${TESTDIR}/messages/next2last-digits_in_parens.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/next2last-digits_in_parens.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  msi
   Do Not Expect Symbol  MIME_DOUBLE_BAD_EXTENSION
 
 Dotted numbers in square brackets is followed by Bad Extension
-  Scan File  ${TESTDIR}/messages/next2last-digits_in_brackets.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/next2last-digits_in_brackets.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  msi
   Do Not Expect Symbol  MIME_DOUBLE_BAD_EXTENSION
 
 Rar4
-  Scan File  ${TESTDIR}/messages/rar4.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/rar4.eml
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  exe
 
 Cloaked Archive Extension
-  Scan File  ${TESTDIR}/messages/f.zip.gz.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/f.zip.gz.eml
   Expect Symbol With Exact Options  MIME_ARCHIVE_IN_ARCHIVE  .zip.gz  zip
 
 Multipart Archive Extension
-  Scan File  ${TESTDIR}/messages/f.zip.001.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/f.zip.001.eml
   Do Not Expect Symbol  MIME_ARCHIVE_IN_ARCHIVE
 
 Exe file, but name in filename_whitelist
-  Scan File  ${TESTDIR}/messages/exe_attm.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/exe_attm.eml
   Do Not Expect Symbol  MIME_BAD_EXTENSION
   Do Not Expect Symbol  MIME_BAD_ATTACHMENT
   Do Not Expect Symbol  MIME_DOUBLE_BAD_EXTENSION
 
 Empty text part should not be treat as html
-  Scan File  ${TESTDIR}/messages/empty-plain-text.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/empty-plain-text.eml
   Do Not Expect Symbol  FORGED_OUTLOOK_HTML
 
 *** Keywords ***
 MIMETypes Setup
-  New Setup  URL_TLD=${URL_TLD}
+  New Setup
diff --git a/test/functional/cases/106_mid.robot b/test/functional/cases/106_mid.robot
index f014940ca..1933213d8 100644
--- a/test/functional/cases/106_mid.robot
+++ b/test/functional/cases/106_mid.robot
@@ -1,36 +1,36 @@
 *** Settings ***
 Suite Setup     New Setup
 Suite Teardown  Normal Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}        ${TESTDIR}/configs/mid.conf
+${CONFIG}        ${RSPAMD_TESTDIR}/configs/mid.conf
 ${RSPAMD_SCOPE}  Suite
-${URL_TLD}       ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD}       ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
 MID - invalid Message-ID
-  Scan File  ${TESTDIR}/messages/fws_fp.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/fws_fp.eml
   Expect Symbol With Score  INVALID_MSGID  1.70
   Do Not Expect Symbol  MISSING_MID
   Do Not Expect Symbol  INVALID_MSGID_ALLOWED
 
 MID - invalid Message-ID allowed
-  Scan File  ${TESTDIR}/messages/invalid_mid_allowed.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/invalid_mid_allowed.eml
   Expect Symbol With Score  INVALID_MSGID_ALLOWED  1.00
   Do Not Expect Symbol  MISSING_MID
   Do Not Expect Symbol  INVALID_MSGID
 
 MID - missing Message-ID
-  Scan File  ${TESTDIR}/messages/freemail.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/freemail.eml
   Expect Symbol With Score  MISSING_MID  2.50
   Do Not Expect Symbol  MISSING_MID_ALLOWED
   Do Not Expect Symbol  INVALID_MSGID
 
 MID - missing Message-ID allowed
-  Scan File  ${TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
+  Scan File  ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
   Expect Symbol With Score  MISSING_MID_ALLOWED  1.00
   Do Not Expect Symbol  MISSING_MID
   Do Not Expect Symbol  INVALID_MSGID
diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot
index 3409c84ff..5f2180ef4 100644
--- a/test/functional/cases/108_settings.robot
+++ b/test/functional/cases/108_settings.robot
@@ -1,22 +1,22 @@
 *** Settings ***
 Suite Setup     Settings Setup
 Suite Teardown  Settings Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/settings.conf
-${LUA_SCRIPT}   ${TESTDIR}/lua/settings.lua
-${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
-${MESSAGE_PRIORITY}      ${TESTDIR}/messages/priority.eml
-${MESSAGE_7BIT}      ${TESTDIR}/messages/utf.eml
-${MESSAGE_CUSTOM_HDR}      ${TESTDIR}/messages/empty-plain-text.eml
-${MESSAGE_ABSENT_MIME}      ${TESTDIR}/messages/ed25519.eml
-${SPAM_MESSAGE}      ${TESTDIR}/messages/spam.eml
-${HAM_MESSAGE}      ${TESTDIR}/messages/ham.eml
+${CONFIG}       ${RSPAMD_TESTDIR}/configs/settings.conf
+${RSPAMD_LUA_SCRIPT}   ${RSPAMD_TESTDIR}/lua/settings.lua
+${MESSAGE}      ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${MESSAGE_PRIORITY}      ${RSPAMD_TESTDIR}/messages/priority.eml
+${MESSAGE_7BIT}      ${RSPAMD_TESTDIR}/messages/utf.eml
+${MESSAGE_CUSTOM_HDR}      ${RSPAMD_TESTDIR}/messages/empty-plain-text.eml
+${MESSAGE_ABSENT_MIME}      ${RSPAMD_TESTDIR}/messages/ed25519.eml
+${SPAM_MESSAGE}      ${RSPAMD_TESTDIR}/messages/spam.eml
+${HAM_MESSAGE}      ${RSPAMD_TESTDIR}/messages/ham.eml
 ${RSPAMD_SCOPE}  Suite
-${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD}      ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
 
 *** Keywords ***
 Check Everything Disabled
@@ -253,9 +253,9 @@ PRIORITY
 
 *** Keywords ***
 Settings Setup
-  Copy File  ${TESTDIR}/data/bayes.spam.sqlite3  /tmp/bayes.spam.sqlite3
-  Copy File  ${TESTDIR}/data/bayes.ham.sqlite3  /tmp/bayes.ham.sqlite3
-  New Setup  LUA_SCRIPT=${LUA_SCRIPT}
+  Copy File  ${RSPAMD_TESTDIR}/data/bayes.spam.sqlite3  /tmp/bayes.spam.sqlite3
+  Copy File  ${RSPAMD_TESTDIR}/data/bayes.ham.sqlite3  /tmp/bayes.ham.sqlite3
+  New Setup
 
 Settings Teardown
   Normal Teardown
diff --git a/test/functional/cases/109_composites.robot b/test/functional/cases/109_composites.robot
index 8c93642dc..4dac8cd24 100644
--- a/test/functional/cases/109_composites.robot
+++ b/test/functional/cases/109_composites.robot
@@ -1,14 +1,14 @@
 *** Settings ***
 Suite Setup     Composites Setup
 Suite Teardown  Simple Teardown
-Library         ${TESTDIR}/lib/rspamd.py
-Resource        ${TESTDIR}/lib/rspamd.robot
-Variables       ${TESTDIR}/lib/vars.py
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/composites.conf
*** OUTPUT TRUNCATED, 3339 LINES SKIPPED ***


More information about the Commits mailing list