Skip to content

Commit

Permalink
[Test] Added more tests for the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Aug 14, 2019
1 parent 104e947 commit 20ba7ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions test/functional/cases/108_settings.robot
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -156,6 +161,7 @@ SETTINGS ID - VIRTUAL SELECTOR
SETTINGS ID - ANGLED RECIPIENT
${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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions test/functional/configs/settings.conf
Expand Up @@ -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
}
}
}
}
Expand Down

0 comments on commit 20ba7ce

Please sign in to comment.