aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-10 15:26:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-10 15:26:46 +0100
commit48eb233fbc0d499536407ba487495fac1ff36a65 (patch)
tree1e202d471fa790a5b3b96b155ff4577e33d13d42 /test
parentcd47af6d6ce8036f2931e1efa3eacd5fff60cb2e (diff)
downloadrspamd-48eb233fbc0d499536407ba487495fac1ff36a65.tar.gz
rspamd-48eb233fbc0d499536407ba487495fac1ff36a65.zip
Save log files on test errors completely.
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