From: Vsevolod Stakhov Date: Wed, 14 Aug 2019 15:03:42 +0000 (+0100) Subject: [Test] Added more tests for the settings X-Git-Tag: 2.0~424 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20ba7ce125c46cf3a965857b4bb7ad7090950c5a;p=rspamd.git [Test] Added more tests for the settings --- diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot index 63985f883..31d04fa1e 100644 --- a/test/functional/cases/108_settings.robot +++ b/test/functional/cases/108_settings.robot @@ -116,6 +116,7 @@ SETTINGS ID - VIRTUAL SETTINGS ID - VIRTUAL GROUP ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings-Id=id_virtual_group Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -124,6 +125,7 @@ SETTINGS ID - VIRTUAL GROUP SETTINGS ID - VIRTUAL FROM ${result} = Scan Message With Rspamc ${MESSAGE} --from test2@example.com Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -132,6 +134,7 @@ SETTINGS ID - VIRTUAL FROM SETTINGS ID - VIRTUAL USER ${result} = Scan Message With Rspamc ${MESSAGE} --user test@example.com Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -140,6 +143,7 @@ SETTINGS ID - VIRTUAL USER SETTINGS ID - VIRTUAL HOSTNAME ${result} = Scan Message With Rspamc ${MESSAGE} --hostname example.com Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -148,6 +152,7 @@ SETTINGS ID - VIRTUAL HOSTNAME SETTINGS ID - VIRTUAL SELECTOR ${result} = Scan Message With Rspamc ${MESSAGE} --rcpt user3@example.com Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -156,6 +161,7 @@ SETTINGS ID - VIRTUAL SELECTOR SETTINGS ID - ANGLED RECIPIENT ${result} = Scan Message With Rspamc ${MESSAGE} --rcpt Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST @@ -164,6 +170,7 @@ SETTINGS ID - ANGLED RECIPIENT SETTINGS ID - VIRTUAL HEADER MATCH ${result} = Scan Message With Rspamc ${MESSAGE_7BIT} Check Rspamc ${result} SIMPLE_VIRTUAL (10 + Should Contain ${result.stdout} EXPLICIT_VIRTUAL (10 Should Not Contain ${result.stdout} SIMPLE_TEST Should Not Contain ${result.stdout} SIMPLE_VIRTUAL1 Should Not Contain ${result.stdout} SIMPLE_POST diff --git a/test/functional/configs/settings.conf b/test/functional/configs/settings.conf index 8a68465f4..34b7613b8 100644 --- a/test/functional/configs/settings.conf +++ b/test/functional/configs/settings.conf @@ -36,8 +36,12 @@ settings { expression = 'user || from || hostname || selector:1 || header:mime_version || header:custom_header || header:1 || request_header:test' apply { - groups_enabled = ["vg"]; - SIMPLE_VIRTUAL = 10.0; + symbols_enabled { + SIMPLE_VIRTUAL = 10.0; + } + symbols { + EXPLICIT_VIRTUAL = 10.0 + } } } }