]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Save log files on test errors completely.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Jul 2015 14:26:46 +0000 (15:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Jul 2015 14:26:46 +0000 (15:26 +0100)
test/functional/functions.sh

index 50c29948b27ecae23108cdfc47b83a4accf8fcdc..457ea2f2c9a328d86d8873bc755700f470592161 100644 (file)
@@ -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