| 1 |
*** Settings *** |
| 2 |
Suite Setup Rspamd Setup |
| 3 |
Suite Teardown Rspamd Teardown |
| 4 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 5 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 6 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 7 |
|
| 8 |
*** Variables *** |
| 9 |
${CONFIG} ${RSPAMD_TESTDIR}/configs/settings_merge.conf |
| 10 |
${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 11 |
${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/settings_merge.lua |
| 12 |
${RSPAMD_SCOPE} Suite |
| 13 |
${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat |
| 14 |
|
| 15 |
*** Test Cases *** |
| 16 |
# Basic: no settings, all symbols fire |
| 17 |
NO SETTINGS - ALL SYMBOLS |
| 18 |
Scan File ${MESSAGE} |
| 19 |
Expect Symbol MERGE_TEST_BASIC |
| 20 |
Expect Symbol MERGE_HARD_DEP |
| 21 |
Expect Symbol MERGE_WEAK_DEP |
| 22 |
Expect Symbol MERGE_GROUP_SYM |
| 23 |
Expect Symbol MERGE_GROUP_SYM2 |
| 24 |
Expect Symbol MERGE_PRE |
| 25 |
|
| 26 |
# Settings-ID enables only specific symbols via precomputed bitsets |
| 27 |
SETTINGS ID - ENABLE SUBSET |
| 28 |
Scan File ${MESSAGE} Settings-Id=merge_profile |
| 29 |
Expect Symbol MERGE_TEST_BASIC |
| 30 |
Expect Symbol MERGE_HARD_DEP |
| 31 |
Expect Symbol MERGE_WEAK_DEP |
| 32 |
Do Not Expect Symbol MERGE_GROUP_SYM |
| 33 |
Do Not Expect Symbol MERGE_GROUP_SYM2 |
| 34 |
|
| 35 |
# Coexistence: Settings-ID controls symbol set, inline Settings overrides actions |
| 36 |
COEXISTENCE - SETTINGS ID AND INLINE ACTIONS |
| 37 |
Scan File ${MESSAGE} Settings-Id=merge_profile Settings={actions {reject = 999.0}} |
| 38 |
Expect Symbol MERGE_TEST_BASIC |
| 39 |
Expect Symbol MERGE_HARD_DEP |
| 40 |
Do Not Expect Symbol MERGE_GROUP_SYM |
| 41 |
Expect Required Score 999 |
| 42 |
|
| 43 |
# Coexistence: Settings-ID controls symbols, inline Settings overrides scores |
| 44 |
COEXISTENCE - SETTINGS ID AND INLINE SCORES |
| 45 |
Scan File ${MESSAGE} Settings-Id=merge_profile Settings={MERGE_TEST_BASIC = 7.77} |
| 46 |
Expect Symbol With Score MERGE_TEST_BASIC 7.77 |
| 47 |
|
| 48 |
# Inline Settings with symbols_enabled |
| 49 |
INLINE SETTINGS - SYMBOLS ENABLED |
| 50 |
Scan File ${MESSAGE} Settings={symbols_enabled = ["MERGE_TEST_BASIC", "MERGE_GROUP_SYM"]} |
| 51 |
Expect Symbol MERGE_TEST_BASIC |
| 52 |
Expect Symbol MERGE_GROUP_SYM |
| 53 |
Do Not Expect Symbol MERGE_WEAK_DEP |
| 54 |
Do Not Expect Symbol MERGE_HARD_DEP |
| 55 |
Do Not Expect Symbol MERGE_GROUP_SYM2 |
| 56 |
|
| 57 |
# Weak dependency: disable MERGE_TEST_BASIC, weak dependent MERGE_WEAK_DEP still runs |
| 58 |
WEAK DEP - DISABLE DEP SYMBOL |
| 59 |
Scan File ${MESSAGE} Settings={symbols_disabled = ["MERGE_TEST_BASIC"]} |
| 60 |
Do Not Expect Symbol MERGE_TEST_BASIC |
| 61 |
Expect Symbol MERGE_WEAK_DEP |
| 62 |
|
| 63 |
# Hard dependency: disable MERGE_TEST_BASIC, hard dependent MERGE_HARD_DEP cascade-disabled |
| 64 |
HARD DEP - CASCADE DISABLE |
| 65 |
Scan File ${MESSAGE} Settings={symbols_disabled = ["MERGE_TEST_BASIC"]} |
| 66 |
Do Not Expect Symbol MERGE_TEST_BASIC |
| 67 |
Do Not Expect Symbol MERGE_HARD_DEP |
| 68 |
|
| 69 |
# Prefilter deps: SETTINGS_APPLY depends on SETTINGS_CHECK, both run correctly |
| 70 |
PREFILTER DEPS WORK |
| 71 |
Scan File ${MESSAGE} Settings={symbols_enabled = ["MERGE_PRE"]} |
| 72 |
Expect Symbol MERGE_PRE |
| 73 |
Do Not Expect Symbol MERGE_TEST_BASIC |
| 74 |
|
| 75 |
# Settings-ID with inline settings providing group disable override |
| 76 |
COEXISTENCE - GROUP SYMBOLS WITH INLINE |
| 77 |
Scan File ${MESSAGE} Settings-Id=merge_group_ctl Settings={actions {reject = 500.0}} |
| 78 |
Expect Symbol MERGE_GROUP_SYM |
| 79 |
Expect Symbol MERGE_GROUP_SYM2 |
| 80 |
Expect Required Score 500 |