Skip to content

Commit

Permalink
[Test] Empty symbols_enabled / groups_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalbanana committed May 24, 2020
1 parent 38bee24 commit 80cb86e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
25 changes: 25 additions & 0 deletions test/functional/cases/108_settings.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ ${HAM_MESSAGE} ${TESTDIR}/messages/ham.eml
${RSPAMD_SCOPE} Suite
${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat

*** Keywords ***
Check Everything Disabled
[Arguments] ${result}
Check Rspamc ${result} Action: no action
Should Not Contain ${result.stdout} SIMPLE_VIRTUAL
Should Not Contain ${result.stdout} SIMPLE_PRE
Should Not Contain ${result.stdout} SIMPLE_POST
Should Not Contain ${result.stdout} BAYES_SPAM

*** Test Cases ***
NO SETTINGS SPAM
${result} = Scan Message With Rspamc ${SPAM_MESSAGE}
Expand All @@ -35,6 +44,22 @@ NO SETTINGS HAM
Should Contain ${result.stdout} SIMPLE_POST
Should Contain ${result.stdout} BAYES_HAM

EMPTY SYMBOLS ENABLED - STATIC
${result} = Scan Message With Rspamc ${SPAM_MESSAGE} -i 5.5.5.5
Check Everything Disabled ${result}

EMPTY GROUPS ENABLED - STATIC
${result} = Scan Message With Rspamc ${SPAM_MESSAGE} -i 5.5.5.6
Check Everything Disabled ${result}

EMPTY SYMBOLS ENABLED - SETTINGS-ID
${result} = Scan Message With Rspamc ${SPAM_MESSAGE} --header Settings-Id=empty_symbols_enabled
Check Everything Disabled ${result}

EMPTY GROUPS ENABLED - SETTINGS-ID
${result} = Scan Message With Rspamc ${SPAM_MESSAGE} --header Settings-Id=empty_groups_enabled
Check Everything Disabled ${result}

ENABLE SYMBOL - NORMAL
${result} = Scan Message With Rspamc ${HAM_MESSAGE} --header Settings={symbols_enabled = ["SIMPLE_TEST"]}
Check Rspamc ${result} SIMPLE_TEST
Expand Down
16 changes: 15 additions & 1 deletion test/functional/configs/settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ settings {
}
}
}

empty_symbols_enabled {
ip = "5.5.5.5";
apply {
symbols_enabled = [];
}
}

empty_groups_enabled {
ip = "5.5.5.6";
apply {
groups_enabled = [];
}
}
}

classifier {
Expand All @@ -82,4 +96,4 @@ classifier {
}
min_learns = 1;
min_token_hits = 1;
}
}

0 comments on commit 80cb86e

Please sign in to comment.