diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-10 13:11:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-10 13:11:19 +0100 |
commit | 7dc7937cee6c3a0b332c37e31e5ce827df893ed2 (patch) | |
tree | 4bea911a8730a2ca7fca9cfa9c05a9407844ce82 /test | |
parent | 1f2807d12777038f7e52eb444ed4c0d780cc8910 (diff) | |
download | rspamd-7dc7937cee6c3a0b332c37e31e5ce827df893ed2.tar.gz rspamd-7dc7937cee6c3a0b332c37e31e5ce827df893ed2.zip |
[Test] Fix statistics tests
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cases/110_statistics/lib.robot | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/functional/cases/110_statistics/lib.robot b/test/functional/cases/110_statistics/lib.robot index 619f355d0..c20c0f651 100644 --- a/test/functional/cases/110_statistics/lib.robot +++ b/test/functional/cases/110_statistics/lib.robot @@ -5,7 +5,8 @@ Variables ${TESTDIR}/lib/vars.py *** Variables *** ${CONFIG} ${TESTDIR}/configs/stats.conf -${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${MESSAGE_SPAM} ${TESTDIR}/messages/spam_message.eml +${MESSAGE_HAM} ${TESTDIR}/messages/ham.eml ${REDIS_SCOPE} Suite ${REDIS_SERVER} ${EMPTY} ${RSPAMD_SCOPE} Suite @@ -14,7 +15,7 @@ ${STATS_KEY} ${EMPTY} *** Keywords *** Broken Learn Test - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM} Check Rspamc ${result} Unknown statistics error Empty Part Test @@ -26,17 +27,20 @@ Empty Part Test Learn Test Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 0 - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE_HAM} Check Rspamc ${result} - ${result} = Scan Message With Rspamc ${MESSAGE} + ${result} = Scan Message With Rspamc ${MESSAGE_SPAM} Check Rspamc ${result} BAYES_SPAM + ${result} = Scan Message With Rspamc ${MESSAGE_HAM} + Check Rspamc ${result} BAYES_HAM Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 1 Relearn Test Run Keyword If ${RSPAMD_STATS_LEARNTEST} == 0 Fail "Learn test was not run" - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE_SPAM} Check Rspamc ${result} - ${result} = Scan Message With Rspamc ${MESSAGE} + ${result} = Scan Message With Rspamc ${MESSAGE_SPAM} ${pass} = Run Keyword And Return Status Check Rspamc ${result} BAYES_HAM Run Keyword If ${pass} Pass Execution What Me Worry Should Not Contain ${result.stdout} BAYES_SPAM |