diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-10 13:41:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-10 13:41:56 +0100 |
commit | 2964a12af4346da027f3d4800b8f12391120e89f (patch) | |
tree | 6c2908cc348df9d988c8adef282ac19c69c6ab88 /test | |
parent | 702366b67df6efabe53fa4953d4ecc9d320ca92c (diff) | |
download | rspamd-2964a12af4346da027f3d4800b8f12391120e89f.tar.gz rspamd-2964a12af4346da027f3d4800b8f12391120e89f.zip |
[Test] Add some classifiers to settings tests
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cases/108_settings.robot | 14 | ||||
-rw-r--r-- | test/functional/configs/settings.conf | 15 |
2 files changed, 27 insertions, 2 deletions
diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot index 44d9b8b4d..9011ad7b3 100644 --- a/test/functional/cases/108_settings.robot +++ b/test/functional/cases/108_settings.robot @@ -9,15 +9,25 @@ Variables ${TESTDIR}/lib/vars.py ${CONFIG} ${TESTDIR}/configs/plugins.conf ${LUA_SCRIPT} ${TESTDIR}/lua/settings.lua ${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${SPAM_MESSAGE} ${TESTDIR}/messages/spam.eml +${HAM_MESSAGE} ${TESTDIR}/messages/ham.eml ${RSPAMD_SCOPE} Suite ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat *** Test Cases *** -NO SETTINGS - ${result} = Scan Message With Rspamc ${MESSAGE} +NO SETTINGS SPAM + ${result} = Scan Message With Rspamc ${SPAM_MESSAGE} Check Rspamc ${result} SIMPLE_TEST Should Contain ${result.stdout} SIMPLE_PRE Should Contain ${result.stdout} SIMPLE_POST + Should Contain ${result.stdout} BAYES_SPAM + +NO SETTINGS HAM + ${result} = Scan Message With Rspamc ${HAM_MESSAGE} + Check Rspamc ${result} SIMPLE_TEST + Should Contain ${result.stdout} SIMPLE_PRE + Should Contain ${result.stdout} SIMPLE_POST + Should Contain ${result.stdout} BAYES_HAM ENABLE SYMBOL - NORMAL ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings={symbols_enabled = ["SIMPLE_TEST"]} diff --git a/test/functional/configs/settings.conf b/test/functional/configs/settings.conf index c2b4ba6cc..091eb5f2c 100644 --- a/test/functional/configs/settings.conf +++ b/test/functional/configs/settings.conf @@ -14,3 +14,18 @@ settings { } } } +classifier { + backend = "sqlite3"; + statfile { + spam = true; + symbol = BAYES_SPAM; + path = "${TESTDIR}/data/bayes.spam.sqlite3"; + } + statfile { + spam = false; + symbol = BAYES_HAM; + path = "${TESTDIR}/data/bayes.ham.sqlite3"; + } + min_learns = 1; + min_token_hits = 1; +}
\ No newline at end of file |