Merge pull request #194 from signalwire/coredump
[Unit-tests] Collect crash data when a unit-test core-dumps
This commit is contained in:
commit
21229ad18f
|
@ -7,6 +7,7 @@ steps:
|
||||||
image: signalwire/freeswitch-public-base
|
image: signalwire/freeswitch-public-base
|
||||||
pull: true
|
pull: true
|
||||||
commands:
|
commands:
|
||||||
|
- cat /proc/sys/kernel/core_pattern
|
||||||
- ./bootstrap.sh -j
|
- ./bootstrap.sh -j
|
||||||
- echo "applications/mod_test" >> modules.conf
|
- echo "applications/mod_test" >> modules.conf
|
||||||
- ./configure
|
- ./configure
|
||||||
|
@ -15,7 +16,8 @@ steps:
|
||||||
- ./build.sh
|
- ./build.sh
|
||||||
- cd tests/unit
|
- cd tests/unit
|
||||||
- ./run-tests.sh
|
- ./run-tests.sh
|
||||||
- mkdir logs && (mv log_run-tests_*.html logs || true)
|
- ls -la /cores
|
||||||
|
- mkdir logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
|
||||||
- echo 0 > run-tests-status.txt
|
- echo 0 > run-tests-status.txt
|
||||||
- ./collect-test-logs.sh && exit 0 || echo 'Some tests failed'
|
- ./collect-test-logs.sh && exit 0 || echo 'Some tests failed'
|
||||||
- echo 1 > run-tests-status.txt
|
- echo 1 > run-tests-status.txt
|
||||||
|
@ -42,6 +44,6 @@ trigger:
|
||||||
- push
|
- push
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: a34718dd1e2b9468a845962219ff05cac0c922ddf90d885af557a937a9e412e0
|
hmac: ee1de4cb1fa925cf61ac67c76c54d553e4376b3a828480d39ce99a67fabae298
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -10,7 +10,12 @@ for name in $logs
|
||||||
do
|
do
|
||||||
logname=$(basename $name)
|
logname=$(basename $name)
|
||||||
testname=$(echo $logname | awk -F 'log_run-tests_' '{print $2}' | awk -F '.html' '{print $1}')
|
testname=$(echo $logname | awk -F 'log_run-tests_' '{print $2}' | awk -F '.html' '{print $1}')
|
||||||
html+="<tr align=\"left\"><td><a href="$logname">$testname</a></td></tr>"
|
html+="<tr align=\"left\"><td><a href="$logname">$testname</a>"
|
||||||
|
backtrace="backtrace_$testname.txt"
|
||||||
|
if test -f "${LOG_DIR}/$backtrace"; then
|
||||||
|
html+=". Core dumped, backtrace is available <a href=\"$backtrace\">here</a>"
|
||||||
|
fi
|
||||||
|
html+="</td></tr>"
|
||||||
logs_found=1
|
logs_found=1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,12 @@ do
|
||||||
rm $logfilename ;
|
rm $logfilename ;
|
||||||
else
|
else
|
||||||
echo "*** ./$i exit status is $exitstatus" ;
|
echo "*** ./$i exit status is $exitstatus" ;
|
||||||
|
if ls /cores/core.*.!drone!src!tests!unit!.libs!$i.* 1> /dev/null 2>&1; then
|
||||||
|
echo "Coredump found";
|
||||||
|
COREDUMP=$(ls /cores/core.*.!drone!src!tests!unit!.libs!$i.*) ;
|
||||||
|
echo $COREDUMP;
|
||||||
|
gdb -ex "set logging file backtrace_$i.txt" -ex "set logging on" -ex "set pagination off" -ex "bt" -ex "bt full" -ex "info threads" -ex "thread apply all bt" -ex "thread apply all bt full" -ex "quit" /drone/src/tests/unit/.libs/$i $COREDUMP ;
|
||||||
|
fi ;
|
||||||
echo "*** $logfilename was saved" ;
|
echo "*** $logfilename was saved" ;
|
||||||
fi ;
|
fi ;
|
||||||
echo "----------------" ;
|
echo "----------------" ;
|
||||||
|
|
Loading…
Reference in New Issue