diff options
Diffstat (limited to 'test/functional/tests.bats')
-rw-r--r-- | test/functional/tests.bats | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/functional/tests.bats b/test/functional/tests.bats index 94051ca89..4f2750dcd 100644 --- a/test/functional/tests.bats +++ b/test/functional/tests.bats @@ -43,9 +43,9 @@ RSPAMC="$BATS_TEST_DIRNAME/../../src/client/rspamc" } @test "Test rspamd learn" { - clear_stats export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ STATSDIR=${BATS_TMPDIR} + clear_stats run_rspamd run ${RSPAMC} -h localhost:56790 \ --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ @@ -66,9 +66,9 @@ RSPAMC="$BATS_TEST_DIRNAME/../../src/client/rspamc" } @test "Test rspamd re-learn" { - clear_stats export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ STATSDIR=${BATS_TMPDIR} + clear_stats run_rspamd run ${RSPAMC} -h localhost:56790 \ --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ @@ -97,9 +97,9 @@ RSPAMC="$BATS_TEST_DIRNAME/../../src/client/rspamc" } @test "Test learn message with an empty part" { - clear_stats export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ STATSDIR=${BATS_TMPDIR} + clear_stats run_rspamd run ${RSPAMC} -h localhost:56790 \ --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ @@ -119,6 +119,20 @@ RSPAMC="$BATS_TEST_DIRNAME/../../src/client/rspamc" clear_stats } +@test "Test learn message with bad statfiles" { + export RSPAMD_CONFIG="$BATS_TEST_DIRNAME/configs/stats.conf" \ + STATSDIR=/non/existent + run_rspamd + run ${RSPAMC} -h localhost:56790 \ + --key y3ms1knmetxf8gdeixkf74b6tbpxqugmxzqksnjodiqei7tksyty \ + learn_spam \ + "$BATS_TEST_DIRNAME/messages/empty_part.eml" + [ "$status" -eq 0 ] + + echo $output >&2 + echo $output | egrep 'cannot open backend' +} + @test "Test rspamd dependencies" { clear_stats sed -e 's|@@LUA_SCRIPT@@|${CURDIR}/functional/cases/deps.lua|' < \ |