diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 17:30:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 17:30:56 +0100 |
commit | cf5959a87b3e0cfec035a0b211b258b4c93b5fa5 (patch) | |
tree | 457c45268b430dd361f1dfcbe441e934c7b5ef45 /test | |
parent | 9db170cc0ca047c4ec39d736a251a6f9bb4fccb8 (diff) | |
download | rspamd-cf5959a87b3e0cfec035a0b211b258b4c93b5fa5.tar.gz rspamd-cf5959a87b3e0cfec035a0b211b258b4c93b5fa5.zip |
Add tests for xxhash and siphash.
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 |