summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/functions.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/functions.sh b/test/functional/functions.sh
index 50c29948b..457ea2f2c 100644
--- a/test/functional/functions.sh
+++ b/test/functional/functions.sh
@@ -4,6 +4,13 @@ save_error() {
printf 'Failed in %s: %s\n' "$_where" "$_reason" > ${TMPDIR}/test.err
mkdir -p /tmp/rspamd-failed-tests/${TEST_NAME} || true
+ # Save logs
+ RSPAMD_PID=`cat ${TMPDIR}/rspamd.pid`
+
+ if [ F"${RSPAMD_PID}" != F"" ] ; then
+ kill -USR1 ${RSPAMD_PID} > /dev/null 2>&1
+ sleep 0.5
+ fi
cp -rf ${TMPDIR}/* /tmp/rspamd-failed-tests/${TEST_NAME}
exit 1