dns = {
nameserver = "8.8.8.8"
}
- pidfile = "/tmp/rspamd-bats.pid"
+ pidfile = "${TMPDIR}/rspamd-bats.pid"
}
logging = {
type = "file",
level = "debug"
- filename = "/tmp/rspamd-bats.log"
+ filename = "${TMPDIR}/rspamd-bats.log"
}
metric = {
name = "default",
}
statfile {
symbol = BAYES_SPAM;
- path = /tmp/rspamd-bats-bayes.spam;
+ path = ${TMPDIR}/rspamd-bats-bayes.spam;
size = 1M;
}
statfile {
symbol = BAYES_HAM;
- path = /tmp/rspamd-bats-bayes.ham;
+ path = ${TMPDIR}/rspamd-bats-bayes.ham;
size = 1M;
}
cache {
name = "sqlite3";
- path = /tmp/rspamd-bats-cache.sqlite;
+ path = ${TMPDIR}/rspamd-bats-cache.sqlite;
}
}
dns = {
nameserver = "8.8.8.8"
}
- pidfile = "/tmp/rspamd-bats.pid"
+ pidfile = "${TMPDIR}/rspamd-bats.pid"
}
logging = {
type = "file",
level = "debug"
- filename = "/tmp/rspamd-bats.log"
+ filename = "${TMPDIR}/rspamd-bats.log"
}
metric = {
name = "default",
+TMPDIR=${BATS_TMPDIR}
+
function run_rspamd() {
+ TMPDIR=${BATS_TMPDIR}
RSPAMD_USER=${RSPAMD_USER:-"nobody"}
RSPAMD_GROUP=${RSPAMD_GROUP:-"nogroup"}
RSPAMD=${RSPAMD:-"$BATS_TEST_DIRNAME/../../src/rspamd"}
- if [ -f /tmp/rspamd-bats.log ] ; then rm -f /tmp/rspamd-bats.log ; fi
- ${RSPAMD} -c ${RSPAMD_CONFIG} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP}
+ if [ -f ${TMPDIR}/rspamd-bats.log ] ; then rm -f ${TMPDIR}/rspamd-bats.log ; fi
+ ${RSPAMD} -c ${RSPAMD_CONFIG} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} TMPDIR=${TMPDIR}
}
}
function clear_stats() {
- rm -f /tmp/rspamd-bats-cache.sqlite /tmp/rspamd-bats-bayes.spam /tmp/rspamd-bats-bayes.ham || true
+ rm -f ${TMPDIR}/rspamd-bats-cache.sqlite ${TMPDIR}/rspamd-bats-bayes.spam ${TMPDIR}/rspamd-bats-bayes.ham || true
}