From: Vsevolod Stakhov Date: Mon, 10 Jun 2019 12:41:56 +0000 (+0100) Subject: [Test] Add some classifiers to settings tests X-Git-Tag: 2.0~804 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2964a12af4346da027f3d4800b8f12391120e89f;p=thirdparty%2Frspamd.git [Test] Add some classifiers to settings tests --- diff --git a/conf/statistic.conf b/conf/statistic.conf index d2b5b147ad..8d45e76083 100644 --- a/conf/statistic.conf +++ b/conf/statistic.conf @@ -24,7 +24,6 @@ classifier "bayes" { name = "osb"; } cache { - path = "${DBDIR}/learn_cache.sqlite"; } new_schema = true; # Always use new schema store_tokens = false; # Redefine if storing of tokens is desired diff --git a/test/functional/cases/108_settings.robot b/test/functional/cases/108_settings.robot index 44d9b8b4d6..9011ad7b35 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 c2b4ba6cc5..091eb5f2c2 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