From 20ba7ce125c46cf3a965857b4bb7ad7090950c5a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 14 Aug 2019 16:03:42 +0100 Subject: [PATCH] [Test] Added more tests for the settings --- test/functional/cases/108_settings.robot | 7 +++++++ test/functional/configs/settings.conf | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) 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 + } } } } -- 2.39.5