diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-15 12:20:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-15 12:20:48 +0100 |
commit | 25931e8fb535905470ef0eb43d2e187a5c5d7783 (patch) | |
tree | d848f9daa817097f7e5737c12c11f88bb671dc01 /test | |
parent | 53e5867c0a79c5bbe93c84003b8dc0793795312b (diff) | |
download | rspamd-25931e8fb535905470ef0eb43d2e187a5c5d7783.tar.gz rspamd-25931e8fb535905470ef0eb43d2e187a5c5d7783.zip |
[Test] Improve settings tests coverage
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cases/108_settings.robot | 4 | ||||
-rw-r--r-- | test/functional/lua/settings.lua | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot index f1b92c214..071ad88d7 100644 --- a/test/functional/cases/108_settings.robot +++ b/test/functional/cases/108_settings.robot @@ -18,6 +18,8 @@ ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat NO SETTINGS SPAM ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} Check Rspamc ${result} SIMPLE_TEST + Should Contain ${result.stdout} SIMPLE_VIRTUAL + Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Contain ${result.stdout} SIMPLE_PRE Should Contain ${result.stdout} SIMPLE_POST Should Contain ${result.stdout} BAYES_SPAM @@ -99,6 +101,7 @@ SETTINGS ID - VIRTUAL ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings-Id=id_virtual Check Rspamc ${result} SIMPLE_VIRTUAL Should Not Contain ${result.stdout} SIMPLE_TEST + Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST Should Not Contain ${result.stdout} SIMPLE_PRE @@ -106,6 +109,7 @@ SETTINGS ID - VIRTUAL GROUP ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings-Id=id_virtual_group Check Rspamc ${result} SIMPLE_VIRTUAL Should Not Contain ${result.stdout} SIMPLE_TEST + Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST Should Not Contain ${result.stdout} SIMPLE_PRE diff --git a/test/functional/lua/settings.lua b/test/functional/lua/settings.lua index 828e1cb37..d0f496c68 100644 --- a/test/functional/lua/settings.lua +++ b/test/functional/lua/settings.lua @@ -25,6 +25,7 @@ local id = rspamd_config:register_symbol({ group = 'b', callback = function(task) task:insert_result('SIMPLE_VIRTUAL', 1.0) + task:insert_result('SIMPLE_VIRTUAL1', 1.0) return true, 'Fires always' end }) @@ -36,3 +37,13 @@ rspamd_config:register_symbol({ group = 'vg', parent = id, }) + +rspamd_config:register_symbol({ + name = 'SIMPLE_VIRTUAL1', + type = 'virtual', + forbidden_ids = 'id_virtual,id_virtual_group', + allowed_ids = 'id_virtual1', + score = 1.0, + group = 'vg', + parent = id, +}) |