aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-08 16:52:00 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-08 16:52:00 +0100
commitee3f09161242a0b24fea0cf18f8accb45d6fdf5a (patch)
treec9c7811d27100856a03ea5c7d667b357819feca0 /test/functional
parent0d881e8bee2374cfb477fc17ae223204b9516015 (diff)
downloadrspamd-ee3f09161242a0b24fea0cf18f8accb45d6fdf5a.tar.gz
rspamd-ee3f09161242a0b24fea0cf18f8accb45d6fdf5a.zip
Add functional test for #331.
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/tests.bats20
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|' < \