commit 5f7dd6e: [Test] Merge test suites; use settings

Andrew Lewis nerf at judo.za.org
Tue May 18 12:21:04 UTC 2021


Author: Andrew Lewis
Date: 2021-05-11 13:50:29 +0200
URL: https://github.com/rspamd/rspamd/commit/5f7dd6e1f27ebec013ed74865f9c1873414380cb (refs/pull/3747/head)

[Test] Merge test suites; use settings

---
 .../cases/{ => 001_merged}/100_general.robot       |  17 +-
 test/functional/cases/001_merged/101_lua.robot     |  41 +++++
 .../cases/{ => 001_merged}/102_multimap.robot      |  77 +++++++-
 .../cases/{ => 001_merged}/104_get_from.robot      |  15 +-
 .../cases/{ => 001_merged}/105_mimetypes.robot     |  18 +-
 .../cases/{ => 001_merged}/106_mid.robot           |  14 +-
 .../cases/{ => 001_merged}/114_phishing.robot      |  15 +-
 .../cases/{ => 001_merged}/115_dmarc.robot         |  23 ++-
 .../cases/{ => 001_merged}/117_spf.robot           |  32 +++-
 .../cases/{ => 001_merged}/160_antivirus.robot     |  27 ++-
 test/functional/cases/001_merged/220_http.robot    |  77 ++++++++
 .../cases/{ => 001_merged}/230_tcp.robot           |  22 +--
 .../functional/cases/001_merged/231_tcp_down.robot |  21 +++
 .../cases/{ => 001_merged}/240_redis.robot         |  12 +-
 .../cases/{ => 001_merged}/250_dns.robot           |  10 +-
 .../cases/{ => 001_merged}/270_selector.robot      |   8 +-
 .../cases/{ => 001_merged}/280_rules.robot         |  33 ++--
 .../cases/{ => 001_merged}/281_fnames.robot        |  10 +-
 .../cases/{ => 001_merged}/290_greylist.robot      |  12 +-
 .../cases/{ => 001_merged}/300_rbl.robot           |  17 +-
 .../cases/{ => 001_merged}/310_udp.robot           |  10 +-
 .../cases/{ => 001_merged}/321_arc_check.robot     |   8 +-
 .../cases/{ => 001_merged}/340_surbl.robot         |  36 +++-
 .../cases/{ => 001_merged}/350_magic.robot         |   9 +-
 test/functional/cases/001_merged/__init__.robot    |  14 ++
 test/functional/cases/101_lua.robot                |  58 ------
 test/functional/cases/220_http.robot               |  68 -------
 test/functional/cases/231_tcp_down.robot           |  31 ----
 test/functional/cases/241_redis_is_dead.robot      |   1 -
 test/functional/cases/260_regex.robot              |   5 +
 test/functional/configs/antivirus.conf             |  43 -----
 test/functional/configs/arc.conf                   |   3 -
 test/functional/configs/dmarc.conf                 |   8 -
 test/functional/configs/greylist.conf              |  13 --
 .../configs/{plugins.conf => merged-local.conf}    | 205 +++++++++++++++++----
 .../{multimap.conf => merged-override.conf}        | 197 ++++++++++++++++++--
 test/functional/configs/merged.conf                |  41 +++++
 test/functional/configs/mid.conf                   |  11 --
 test/functional/configs/mime_types.conf            |  21 ---
 test/functional/configs/phishing.conf              |  13 --
 test/functional/configs/rbl.conf                   |  77 --------
 test/functional/configs/selector.conf              |  10 -
 test/functional/configs/surbl.conf                 |  93 ----------
 test/functional/lib/rspamd.robot                   |   5 +
 test/functional/lua/get_from.lua                   |   8 +-
 test/functional/lua/http.lua                       |   6 +-
 test/functional/lua/maps_kv.lua                    |   6 +-
 47 files changed, 845 insertions(+), 656 deletions(-)

diff --git a/test/functional/cases/100_general.robot b/test/functional/cases/001_merged/100_general.robot
similarity index 71%
rename from test/functional/cases/100_general.robot
rename to test/functional/cases/001_merged/100_general.robot
index e76b07c54..b06dd1492 100644
--- a/test/functional/cases/100_general.robot
+++ b/test/functional/cases/001_merged/100_general.robot
@@ -1,33 +1,32 @@
 *** Settings ***
-Suite Setup     Rspamd Setup
-Suite Teardown  Rspamd Teardown
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
 Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}          ${RSPAMD_TESTDIR}/configs/trivial.conf
-${GTUBE}           ${RSPAMD_TESTDIR}/messages/gtube.eml
-${RSPAMD_SCOPE}    Suite
-${RSPAMD_URL_TLD}  ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${GTUBE}               ${RSPAMD_TESTDIR}/messages/gtube.eml
+${SETTINGS_NOSYMBOLS}  {symbols_enabled = []}
 
 *** Test Cases ***
 GTUBE
   Scan File  ${GTUBE}
+  ...  Settings=${SETTINGS_NOSYMBOLS}
   Expect Symbol  GTUBE
 
 GTUBE - Encrypted
   ${result} =  Run Rspamc  -p  -h  ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL}  --key  ${RSPAMD_KEY_PUB1}
-  ...  ${GTUBE}
+  ...  ${GTUBE}  --header=Settings=${SETTINGS_NOSYMBOLS}
   Check Rspamc  ${result}  GTUBE (
 
 GTUBE - Scan File feature
   Scan File By Reference  ${GTUBE}
+  ...  Settings=${SETTINGS_NOSYMBOLS}
   Expect Symbol  GTUBE
 
 GTUBE - Scan File feature (encoded)
   ${encoded} =  Encode Filename  ${GTUBE}
   Scan File By Reference  ${encoded}
+  ...  Settings=${SETTINGS_NOSYMBOLS}
   Expect Symbol  GTUBE
 
 GTUBE - SPAMC
@@ -39,12 +38,14 @@ GTUBE - RSPAMC
   Should Contain  ${result}  GTUBE
 
 EMAILS DETECTION 1
-  Scan File  ${RSPAMD_TESTDIR}/messages/emails1.eml  URL-Format=Extended
+  Scan File  ${RSPAMD_TESTDIR}/messages/emails1.eml
+  ...  URL-Format=Extended  Settings=${SETTINGS_NOSYMBOLS}
   Expect Email  jim at example.net
   Expect Email  bob at example.net
   Expect Email  rupert at example.net
 
 EMAILS DETECTION ZEROFONT
   Scan File  ${RSPAMD_TESTDIR}/messages/zerofont.eml
+  ...  Settings={symbols_enabled = [MANY_INVISIBLE_PARTS, ZERO_FONT]}
   Expect Symbol  MANY_INVISIBLE_PARTS
   Expect Symbol  ZERO_FONT
diff --git a/test/functional/cases/001_merged/101_lua.robot b/test/functional/cases/001_merged/101_lua.robot
new file mode 100644
index 000000000..23637396a
--- /dev/null
+++ b/test/functional/cases/001_merged/101_lua.robot
@@ -0,0 +1,41 @@
+*** Settings ***
+Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables       ${RSPAMD_TESTDIR}/lib/vars.py
+
+*** Variables ***
+${MESSAGE}            ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RSPAMD_MAP_MAP}     ${RSPAMD_TESTDIR}/configs/maps/map.list
+${RSPAMD_RADIX_MAP}   ${RSPAMD_TESTDIR}/configs/maps/ip2.list
+${RSPAMD_REGEXP_MAP}  ${RSPAMD_TESTDIR}/configs/maps/regexp.list
+
+*** Test Cases ***
+Recipient Parsing Sanity
+  Scan File  ${MESSAGE}  Rcpt=rcpt1 at foobar,rcpt2 at foobar,rcpt3 at foobar,rcpt4 at foobar
+  ...  Settings={symbols_enabled = [TEST_RCPT]}
+  Expect Symbol With Exact Options  TEST_RCPT  rcpt1 at foobar,rcpt2 at foobar,rcpt3 at foobar,rcpt4 at foobar
+
+TLD parts
+  Scan File  ${MESSAGE}  Settings={symbols_enabled = [TEST_TLD]}
+  Expect Symbol With Exact Options  TEST_TLD  no worry
+
+Hashes
+  Scan File  ${MESSAGE}  Settings={symbols_enabled = [TEST_HASHES]}
+  Expect Symbol With Exact Options  TEST_HASHES  no worry
+
+Maps Key Values
+  Scan File  ${MESSAGE}  Settings={symbols_enabled = [RADIX_KV, REGEXP_KV, MAP_KV]}
+  Expect Symbol With Exact Options  RADIX_KV  no worry
+  Expect Symbol With Exact Options  REGEXP_KV  no worry
+  Expect Symbol With Exact Options  MAP_KV  no worry
+
+Option Order
+  Scan File  ${MESSAGE}  Settings={symbols_enabled = [OPTION_ORDER, TBL_OPTION_ORDER]}
+  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
+  Scan File  ${MESSAGE}  Settings={symbols_enabled = [ANY_A]}
+  Expect Symbol With Option  ANY_A  hello3
+  Expect Symbol With Option  ANY_A  hello1
+  Expect Symbol With Option  ANY_A  hello2
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/001_merged/102_multimap.robot
similarity index 70%
rename from test/functional/cases/102_multimap.robot
rename to test/functional/cases/001_merged/102_multimap.robot
index 8085ad748..fcd75a8bc 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/001_merged/102_multimap.robot
@@ -1,21 +1,15 @@
 *** Settings ***
-Suite Setup     Rspamd Redis Setup
-Suite Teardown  Rspamd Redis Teardown
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
 Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}          ${RSPAMD_TESTDIR}/configs/multimap.conf
 ${FREEMAIL_CC}     ${RSPAMD_TESTDIR}/messages/freemailcc.eml
 ${MESSAGE}         ${RSPAMD_TESTDIR}/messages/spam_message.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
-${REDIS_SCOPE}     Suite
-${RSPAMD_SCOPE}    Suite
-${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
@@ -27,282 +21,348 @@ ${UTF_MESSAGE}     ${RSPAMD_TESTDIR}/messages/utf.eml
 *** Test Cases ***
 URL_ICS
   Scan File  ${URL_ICS}
+  ...   Settings={symbols_enabled = []}
   Expect URL  test.com
 
 MAP - DNSBL HIT
   Scan File  ${MESSAGE}  IP=127.0.0.2
+  ...   Settings={symbols_enabled = [DNSBL_MAP]}
   Expect Symbol  DNSBL_MAP
 
 MAP - DNSBL MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1
+  ...   Settings={symbols_enabled = [DNSBL_MAP]}
   Do Not Expect Symbol  DNSBL_MAP
 
 MAP - IP HIT
   Scan File  ${MESSAGE}  IP=127.0.0.1
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Expect Symbol  IP_MAP
 
 MAP - IP MISS
   Scan File  ${MESSAGE}  IP=127.0.0.2
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Do Not Expect Symbol  IP_MAP
 
 MAP - IP MASK
   Scan File  ${MESSAGE}  IP=10.1.0.10
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Expect Symbol  IP_MAP
 
 MAP - IP MASK MISS
   Scan File  ${MESSAGE}  IP=11.1.0.10
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Do Not Expect Symbol  IP_MAP
 
 MAP - IP V6
   Scan File  ${MESSAGE}  IP=::1
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Expect Symbol  IP_MAP
 
 MAP - IP V6 MISS
   Scan File  ${MESSAGE}  IP=fe80::1
+  ...   Settings={symbols_enabled = [IP_MAP]}
   Do Not Expect Symbol  IP_MAP
 
 MAP - FROM
   Scan File  ${MESSAGE}  From=user at example.com
+  ...   Settings={symbols_enabled = [FROM_MAP]}
   Expect Symbol  FROM_MAP
 
 MAP - COMBINED IP MASK FROM
   Scan File  ${MESSAGE}  IP=10.1.0.10  From=user at example.com
+  ...   Settings={symbols_enabled = [COMBINED_MAP_AND, COMBINED_MAP_OR]}
   Expect Symbol With Score  COMBINED_MAP_AND  10
   Expect Symbol  COMBINED_MAP_OR
 
 MAP - COMBINED IP MASK ONLY
   Scan File  ${MESSAGE}  IP=10.1.0.10
+  ...   Settings={symbols_enabled = [COMBINED_MAP_AND, COMBINED_MAP_OR]}
   Do Not Expect Symbol  COMBINED_MAP_AND
   Expect Symbol  COMBINED_MAP_OR
 
 MAP - COMBINED FROM ONLY
   Scan File  ${MESSAGE}  From=user at example.com
+  ...   Settings={symbols_enabled = [COMBINED_MAP_AND, COMBINED_MAP_OR]}
   Do Not Expect Symbol  COMBINED_MAP_AND
   Expect Symbol  COMBINED_MAP_OR
 
 MAP - COMBINED MISS
   Scan File  ${MESSAGE}  IP=11.1.0.10  From=user at other.com
+  ...   Settings={symbols_enabled = [COMBINED_MAP_AND, COMBINED_MAP_OR]}
   Do Not Expect Symbol  COMBINED_MAP_AND
   Do Not Expect Symbol  COMBINED_MAP_OR
 
 MAP - FROM MISS
   Scan File  ${MESSAGE}  From=user at other.com
+  ...   Settings={symbols_enabled = [FROM_MAP]}
   Do Not Expect Symbol  FROM_MAP
 
 MAP - FROM REGEXP
   Scan File  ${MESSAGE}  From=user123 at test.com
+  ...   Settings={symbols_enabled = [REGEXP_MAP]}
   Expect Symbol  REGEXP_MAP
   Scan File  ${MESSAGE}  From=somebody at example.com
+  ...   Settings={symbols_enabled = [REGEXP_MAP]}
   Expect Symbol  REGEXP_MAP
 
 MAP - FROM REGEXP MISS
   Scan File  ${MESSAGE}  From=user at other.org
+  ...   Settings={symbols_enabled = [REGEXP_MAP]}
   Do Not Expect Symbol  REGEXP_MAP
 
 MAP - RCPT DOMAIN HIT
   Scan File  ${MESSAGE}  Rcpt=user at example.com
+  ...   Settings={symbols_enabled = [RCPT_DOMAIN]}
   Expect Symbol  RCPT_DOMAIN
 
 MAP - RCPT DOMAIN MISS
   Scan File  ${MESSAGE}  Rcpt=example.com at user
+  ...   Settings={symbols_enabled = [RCPT_DOMAIN]}
   Do Not Expect Symbol  RCPT_DOMAIN
 
 MAP - RCPT USER HIT
   Scan File  ${MESSAGE}  Rcpt=bob at example.com
+  ...   Settings={symbols_enabled = [RCPT_USER]}
   Expect Symbol  RCPT_USER
 
 MAP - RCPT USER MISS
   Scan File  ${MESSAGE}  From=example.com at bob
+  ...   Settings={symbols_enabled = [RCPT_USER]}
   Do Not Expect Symbol  RCPT_USER
 
 MAP - DEPENDS HIT
   Scan File  ${MESSAGE}  IP=88.99.142.95  From=user123 at rspamd.com
+  ...   Settings={symbols_enabled = [DEPS_MAP,REGEXP_MAP,FROM_MAP,SPF_CHECK]}
   Expect Symbol  DEPS_MAP
 
 MAP - DEPENDS MISS
   Scan File  ${MESSAGE}  IP=1.2.3.4  From=user123 at rspamd.com
+  ...   Settings={symbols_enabled = [DEPS_MAP,REGEXP_MAP,FROM_MAP,SPF_CHECK]}
   Do Not Expect Symbol  DEPS_MAP
 
 MAP - MULSYM PLAIN
   Scan File  ${MESSAGE}  Rcpt=user1 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP, SYM1]}
   Expect Symbol  RCPT_MAP
 
 MAP - MULSYM SCORE
   Scan File  ${MESSAGE}  Rcpt=user2 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP, SYM1]}
   Expect Symbol With Score  RCPT_MAP  10.0
 
 MAP - MULSYM SYMBOL
   Scan File  ${MESSAGE}  Rcpt=user3 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP, SYM1]}
   Expect Symbol With Score  SYM1  1.0
 
 MAP - MULSYM SYMBOL MISS
   Scan File  ${MESSAGE}  Rcpt=user4 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP, SYM1]}
   Expect Symbol With Score  RCPT_MAP  1.0
 
 MAP - MULSYM SYMBOL + SCORE
   Scan File  ${MESSAGE}  Rcpt=user5 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP, SYM1]}
   Expect Symbol With Score  SYM1  -10.1
 
 MAP - UTF
   Scan File  ${UTF_MESSAGE}
+  ...   Settings={symbols_enabled = [HEADER_MAP]}
   Expect Symbol  HEADER_MAP
 
 MAP - UTF MISS
   Scan File  ${MESSAGE}
+  ...   Settings={symbols_enabled = [HEADER_MAP]}
   Do Not Expect Symbol  HEADER_MAP
 
 MAP - HOSTNAME
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=example.com
+  ...   Settings={symbols_enabled = [HOSTNAME_MAP]}
   Expect Symbol  HOSTNAME_MAP
 
 MAP - HOSTNAME MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=rspamd.com
+  ...   Settings={symbols_enabled = [HOSTNAME_MAP]}
   Do Not Expect Symbol  HOSTNAME_MAP
 
 MAP - TOP
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=example.com.au
+  ...   Settings={symbols_enabled = [HOSTNAME_TOP_MAP]}
   Expect Symbol  HOSTNAME_TOP_MAP
 
 MAP - TOP MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=example.com.bg
+  ...   Settings={symbols_enabled = [HOSTNAME_TOP_MAP]}
   Do Not Expect Symbol  HOSTNAME_TOP_MAP
 
 MAP - CDB - HOSTNAME
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=example.com
+  ...   Settings={symbols_enabled = [CDB_HOSTNAME]}
   Expect Symbol  CDB_HOSTNAME
 
 MAP - CDB - HOSTNAME MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=rspamd.com
+  ...   Settings={symbols_enabled = [CDB_HOSTNAME]}
   Do Not Expect Symbol  CDB_HOSTNAME
 
 MAP - REDIS - HOSTNAME
   Redis HSET  hostname  redistest.example.net  ${EMPTY}
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=redistest.example.net
+  ...   Settings={symbols_enabled = [REDIS_HOSTNAME]}
   Expect Symbol  REDIS_HOSTNAME
 
 MAP - REDIS - HOSTNAME MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=rspamd.com
+  ...   Settings={symbols_enabled = [REDIS_HOSTNAME]}
   Do Not Expect Symbol  REDIS_HOSTNAME
 
 MAP - REDIS - HOSTNAME - EXPANSION - HIT
   Redis HSET  127.0.0.1.foo.com  redistest.example.net  ${EMPTY}
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=redistest.example.net  Rcpt=bob at foo.com
+  ...   Settings={symbols_enabled = [REDIS_HOSTNAME_EXPANSION]}
   Expect Symbol  REDIS_HOSTNAME_EXPANSION
 
 MAP - REDIS - HOSTNAME - EXPANSION - MISS
   Scan File  ${MESSAGE}  IP=127.0.0.1  Hostname=redistest.example.net  Rcpt=bob at bar.com
+  ...   Settings={symbols_enabled = [REDIS_HOSTNAME_EXPANSION]}
   Do Not Expect Symbol  REDIS_HOSTNAME_EXPANSION
 
 MAP - REDIS - IP
   Redis HSET  ipaddr  127.0.0.1  ${EMPTY}
   Scan File  ${MESSAGE}  IP=127.0.0.1
+  ...   Settings={symbols_enabled = [REDIS_IPADDR]}
   Expect Symbol  REDIS_IPADDR
 
 MAP - REDIS - IP - MISS
   Scan File  ${MESSAGE}  IP=8.8.8.8
+  ...   Settings={symbols_enabled = [REDIS_IPADDR]}
   Do Not Expect Symbol  REDIS_IPADDR
 
 MAP - REDIS - FROM
   Redis HSET  emailaddr  from at rspamd.tk  ${EMPTY}
   Scan File  ${MESSAGE}  From=from at rspamd.tk
+  ...   Settings={symbols_enabled = [REDIS_FROMADDR]}
   Expect Symbol  REDIS_FROMADDR
 
 MAP - REDIS - FROM MISS
   Scan File  ${MESSAGE}  From=user at other.com
+  ...   Settings={symbols_enabled = [REDIS_FROMADDR]}
   Do Not Expect Symbol  REDIS_FROMADDR
 
 MAP - REDIS - URL TLD - HIT
   Redis HSET  hostname  example.com  ${EMPTY}
   Scan File  ${URL1}
+  ...   Settings={symbols_enabled = [REDIS_URL_TLD]}
   Expect Symbol  REDIS_URL_TLD
 
 MAP - REDIS - URL TLD - MISS
   Scan File  ${URL2}
+  ...   Settings={symbols_enabled = [REDIS_URL_TLD]}
   Do Not Expect Symbol  REDIS_URL_TLD
 
 MAP - REDIS - URL RE FULL - HIT
   Redis HSET  fullurlre  html  ${EMPTY}
   Scan File  ${URL2}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_FULL]}
   Expect Symbol  REDIS_URL_RE_FULL
 
 MAP - REDIS - URL RE FULL - MISS
   Scan File  ${URL1}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_FULL]}
   Do Not Expect Symbol  REDIS_URL_RE_FULL
 
 MAP - REDIS - URL FULL - HIT
   Redis HSET  fullurl  https://www.example.com/foo?a=b  ${EMPTY}
   Scan File  ${URL1}
+  ...   Settings={symbols_enabled = [REDIS_URL_FULL]}
   Expect Symbol  REDIS_URL_FULL
 
 MAP - REDIS - URL FULL - MISS
   Scan File  ${URL2}
+  ...   Settings={symbols_enabled = [REDIS_URL_FULL]}
   Do Not Expect Symbol  REDIS_URL_FULL
 
 MAP - REDIS - URL PHISHED - HIT
   Redis HSET  phishedurl  www.rspamd.com  ${EMPTY}
   Scan File  ${URL3}
+  ...   Settings={symbols_enabled = [REDIS_URL_PHISHED]}
   Expect Symbol  REDIS_URL_PHISHED
 
 MAP - REDIS - URL PHISHED - MISS
   Scan File  ${URL4}
+  ...   Settings={symbols_enabled = [REDIS_URL_PHISHED]}
   Do Not Expect Symbol  REDIS_URL_PHISHED
 
 MAP - REDIS - URL PLAIN REGEX - HIT
   Redis HSET  urlre  www  ${EMPTY}
   Scan File  ${URL3}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_PLAIN]}
   Expect Symbol  REDIS_URL_RE_PLAIN
 
 MAP - REDIS - URL PLAIN REGEX - MISS
   Scan File  ${URL4}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_PLAIN]}
   Do Not Expect Symbol  REDIS_URL_RE_PLAIN
 
 MAP - REDIS - URL TLD REGEX - HIT
   Redis HSET  tldre  net  ${EMPTY}
   Scan File  ${URL5}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_TLD]}
   Expect Symbol  REDIS_URL_RE_TLD
 
 MAP - REDIS - URL TLD REGEX - MISS
   Scan File  ${URL4}
+  ...   Settings={symbols_enabled = [REDIS_URL_RE_TLD]}
   Do Not Expect Symbol  REDIS_URL_RE_TLD
 
 MAP - REDIS - URL NOFILTER - HIT
   Redis HSET  urlnofilter  www.example.net  ${EMPTY}
   Scan File  ${URL5}
+  ...   Settings={symbols_enabled = [REDIS_URL_NOFILTER]}
   Expect Symbol  REDIS_URL_NOFILTER
 
 MAP - REDIS - URL NOFILTER - MISS
   Scan File  ${URL4}
+  ...   Settings={symbols_enabled = [REDIS_URL_NOFILTER]}
   Do Not Expect Symbol  REDIS_URL_NOFILTER
 
 MAP - REDIS - ASN - HIT
   Redis HSET  asn  15169  ${EMPTY}
   Scan File  ${MESSAGE}  IP=8.8.8.8
+  ...   Settings={symbols_enabled = [REDIS_ASN, ASN_CHECK]}
   Expect Symbol  REDIS_ASN
 
 MAP - REDIS - ASN - MISS
   Scan File  ${MESSAGE}  IP=46.228.47.114
+  ...   Settings={symbols_enabled = [REDIS_ASN, ASN_CHECK]}
   Do Not Expect Symbol  REDIS_ASN
 
 MAP - REDIS - CC - HIT
   Redis HSET  cc  US  ${EMPTY}
   Scan File  ${MESSAGE}  IP=8.8.8.8
+  ...   Settings={symbols_enabled = [REDIS_COUNTRY, ASN_CHECK]}
   Expect Symbol  REDIS_COUNTRY
 
 MAP - REDIS - CC - MISS
   Scan File  ${MESSAGE}  IP=46.228.47.114
+  ...   Settings={symbols_enabled = [REDIS_COUNTRY, ASN_CHECK]}
   Do Not Expect Symbol  REDIS_COUNTRY
 
 MAP - REDIS - ASN FILTERED - HIT
   Redis HSET  asn  1  ${EMPTY}
   Scan File  ${MESSAGE}  IP=8.8.8.8
+  ...   Settings={symbols_enabled = [REDIS_ASN_FILTERED, ASN_CHECK]}
   Expect Symbol  REDIS_ASN_FILTERED
 
 MAP - REDIS - ASN FILTERED - MISS
   Scan File  ${MESSAGE}  IP=46.228.47.114
+  ...   Settings={symbols_enabled = [REDIS_ASN_FILTERED, ASN_CHECK]}
   Do Not Expect Symbol  REDIS_ASN_FILTERED
 
 MAP - RECEIVED - IP MINMAX POS - ONE
   Scan File  ${RCVD1}
+  ...   Settings={symbols_enabled = [RCVD_TEST_01, RCVD_TEST02]}
   Expect Symbol  RCVD_TEST_01
   Do Not Expect Symbol  RCVD_TEST_02
 
@@ -316,22 +376,27 @@ MAP - RECEIVED - IP MINMAX POS - ONE
 MAP - RECEIVED - REDIS
   Redis HSET  RCVD_TEST  2a01:7c8:aab6:26d:5054:ff:fed1:1da2  ${EMPTY}
   Scan File  ${RCVD1}
+  ...   Settings={symbols_enabled = [RCVD_TEST_REDIS_01]}
   Expect Symbol  RCVD_TEST_REDIS_01
 
 RCVD_AUTHED_ONE & RCVD_AUTHED_TWO - MISS
   Scan File  ${RCVD3}
+  ...   Settings={symbols_enabled = [RCVD_AUTHED_ONE, RCVD_AUTHED_TWO]}
   Do Not Expect Symbol  RCVD_AUTHED_ONE
   Do Not Expect Symbol  RCVD_AUTHED_TWO
 
 RCVD_AUTHED_TWO HIT / RCVD_AUTHED_ONE MISS
   Scan File  ${RCVD4}
+  ...   Settings={symbols_enabled = [RCVD_AUTHED_ONE, RCVD_AUTHED_TWO]}
   Expect Symbol  RCVD_AUTHED_TWO
   Do Not Expect Symbol  RCVD_AUTHED_ONE
 
 FREEMAIL_CC
   Scan File  ${FREEMAIL_CC}
+  ...   Settings={symbols_enabled = [FREEMAIL_CC]}
   Expect Symbol With Score And Exact Options  FREEMAIL_CC  19.00  test.com  test1.com  test2.com  test3.com  test4.com  test5.com  test6.com  test7.com  test8.com  test9.com  test10.com  test11.com  test12.com  test13.com  test14.com
 
 MAP - MULTISYMBOL DISABLED
   Scan File  ${MESSAGE}  Rcpt=user3 at example.com
+  ...   Settings={symbols_enabled = [RCPT_MAP_NOMULTISYM, SYM1]}
   Expect Symbol With Exact Options  RCPT_MAP_NOMULTISYM  user3 at example.com  SYM1
diff --git a/test/functional/cases/104_get_from.robot b/test/functional/cases/001_merged/104_get_from.robot
similarity index 84%
rename from test/functional/cases/104_get_from.robot
rename to test/functional/cases/001_merged/104_get_from.robot
index 84b754f37..f01119f86 100644
--- a/test/functional/cases/104_get_from.robot
+++ b/test/functional/cases/001_merged/104_get_from.robot
@@ -1,52 +1,57 @@
 *** Settings ***
-Suite Setup     Rspamd Setup
-Suite Teardown  Rspamd Teardown
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
 Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}             ${RSPAMD_TESTDIR}/configs/lua_script.conf
 ${OPTIONS1}           ,user at example.org,user,example.org
 ${OPTIONS2}           First Last,user at example.org,user,example.org
 ${OPTIONS3}           First M. Last,user at example.org,user,example.org
-${RSPAMD_LUA_SCRIPT}  ${RSPAMD_TESTDIR}/lua/get_from.lua
-${RSPAMD_SCOPE}       Suite
+${SETTINGS_GETFROM}   {symbols_enabled = [${SYMBOL}]}
 ${SYMBOL}             GET_FROM
 
 *** Test Cases ***
 task:get_from('mime') - address only
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol  ${SYMBOL}
 
 task:get_from('mime') - comment
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_comment.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS1}
 
 task:get_from('mime') - display name
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS2}
 
 task:get_from('mime') - display name Base64
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn_base64.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  Кириллица,user at example.org,user,example.org
 
 task:get_from('mime') - display name and comment
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_dn_comment.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS2}
 
 task:get_from('mime') - quoted display name
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted display name and comment
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_comment.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted in the middle of DN (outer spaces)
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
 
 task:get_from('mime') - quoted in the middle of DN (inner spaces)
   Scan File  ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
+  ...  Settings=${SETTINGS_GETFROM}
   Expect Symbol With Exact Options  ${SYMBOL}  ${OPTIONS3}
diff --git a/test/functional/cases/105_mimetypes.robot b/test/functional/cases/001_merged/105_mimetypes.robot
similarity index 81%
rename from test/functional/cases/105_mimetypes.robot
rename to test/functional/cases/001_merged/105_mimetypes.robot
index aa344aebd..e16150aa8 100644
--- a/test/functional/cases/105_mimetypes.robot
+++ b/test/functional/cases/001_merged/105_mimetypes.robot
@@ -1,66 +1,74 @@
 *** Settings ***
-Suite Setup     Rspamd Setup
-Suite Teardown  Rspamd Teardown
 Library         ${RSPAMD_TESTDIR}/lib/rspamd.py
 Resource        ${RSPAMD_TESTDIR}/lib/rspamd.robot
 Variables       ${RSPAMD_TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}          ${RSPAMD_TESTDIR}/configs/mime_types.conf
-${RSPAMD_SCOPE}    Suite
-${RSPAMD_URL_TLD}  ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${SETTINGS_MIMETYPES}  {symbols_enabled = [MIME_TYPES_CALLBACK]}
 
 *** Test Cases ***
 Zip
   Scan File  ${RSPAMD_TESTDIR}/messages/zip.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   Expect Symbol With Exact Options  MIME_BAD_EXTENSION  exe
 
 Zip Double Bad Extension
   Scan File  ${RSPAMD_TESTDIR}/messages/zip-doublebad.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   Expect Symbol With Exact Options  MIME_DOUBLE_BAD_EXTENSION  .pdf.exe
 
 Next-to-last Double Bad Extension
   Scan File  ${RSPAMD_TESTDIR}/messages/next2last-doublebad.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   Expect Symbol With Exact Options  MIME_DOUBLE_BAD_EXTENSION  .scr.xz
 
 Date is followed by Bad Extension
   Scan File  ${RSPAMD_TESTDIR}/messages/rar-date-bad-ext.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   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  ${RSPAMD_TESTDIR}/messages/bad_ext.dotted_file_name.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   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  ${RSPAMD_TESTDIR}/messages/next2last-digits_in_parens.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
   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  ${RSPAMD_TESTDIR}/messages/next2last-digits_in_brackets.eml
+  ...  Settings=${SETTINGS_MIMETYPES}
*** OUTPUT TRUNCATED, 2577 LINES SKIPPED ***


More information about the Commits mailing list