diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/tests.bats | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/functional/tests.bats b/test/functional/tests.bats index 9cb945ea5..9677c869c 100644 --- a/test/functional/tests.bats +++ b/test/functional/tests.bats @@ -151,6 +151,54 @@ RSPAMC="$BATS_TEST_DIRNAME/../../src/client/rspamc" clear_stats } +@test "Test rspamd xxhash tokenizer" { + export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ + STATSDIR=${BATS_TMPDIR} \ + STATS_HASH="xxh" + clear_stats + run_rspamd + run ${RSPAMC} -h localhost:56790 \ + --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ + learn_spam \ + "$BATS_TEST_DIRNAME/messages/spam_message.eml" + [ "$status" -eq 0 ] + + echo $output | egrep 'success.*true' + + run ${RSPAMC} -h localhost:56789 \ + --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ + symbols \ + "$BATS_TEST_DIRNAME/messages/spam_message.eml" + [ "$status" -eq 0 ] + + echo $output | grep 'BAYES_SPAM' + clear_stats +} + +@test "Test rspamd siphash tokenizer" { + export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ + STATSDIR=${BATS_TMPDIR} \ + STATS_HASH="siphash" + clear_stats + run_rspamd + run ${RSPAMC} -h localhost:56790 \ + --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ + learn_spam \ + "$BATS_TEST_DIRNAME/messages/spam_message.eml" + [ "$status" -eq 0 ] + + echo $output | egrep 'success.*true' + + run ${RSPAMC} -h localhost:56789 \ + --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ + symbols \ + "$BATS_TEST_DIRNAME/messages/spam_message.eml" + [ "$status" -eq 0 ] + + echo $output | grep 'BAYES_SPAM' + clear_stats +} + @test "Test learn message with bad statfiles" { export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ STATSDIR=/non/existent |