Add more debug output to Travis script

This commit is contained in:
Jon Siwek 2018-11-01 19:56:00 -05:00
parent 5ddb2b37c0
commit 53f4e09342
3 changed files with 44 additions and 7 deletions

View file

@ -1,4 +1,8 @@
2.6-beta2-61 | 2018-11-01 19:57:32 -0500
* Add more debug output to Travis script (Jon Siwek, Corelight)
2.6-beta2-60 | 2018-11-01 18:35:26 -0500
* Add core file search and stack trace output for Travis builds (Jon Siwek, Corelight)

View file

@ -1 +1 @@
2.6-beta2-60
2.6-beta2-61

View file

@ -179,6 +179,7 @@ get_private_tests() {
# Run Bro tests.
run() {
ulimit -c unlimited
ulimit -a
echo
echo "Running unit tests ##################################################"
echo
@ -220,6 +221,11 @@ run() {
echo
echo "Running external tests ##############################################"
echo
set +e
if [ -d bro-testing ]; then
cd bro-testing
make
if [ $? -ne 0 ]; then
@ -227,12 +233,39 @@ run() {
ret=1
fi
cd ..
fi
if [ -d bro-testing-private]; then
cd bro-testing-private
make
if [ $? -ne 0 ]; then
showdiag
ret=1
fi
cd ..
fi
cd ../..
echo
echo "Result code after running tests: $ret"
if [ $ret -ne 0 ]; then
COREFILE=`find testing/btest/.tmp testing/external/*/.tmp -name "core*" | head -n 1`
COREDUMP_FIND=`find testing/btest/.tmp testing/external/*/.tmp -name core*`
COREFILE=`find testing/btest/.tmp testing/external/*/.tmp -name core* | head -n 1`
echo
echo "Search for core dumps ##############################################"
echo
echo `pwd`
echo
echo $COREDUMP_FIND
if [ -f "$COREFILE" ]; then
echo "Getting stack trace from $COREFILE"
gdb build/src/bro -c "$COREFILE" -ex "thread apply all bt" -ex "set pagination 0" -batch;
fi
fi
@ -243,7 +276,7 @@ run() {
# Show failed tests (not skipped tests) from diag.log when a test fails.
showdiag() {
f=bro-testing/diag.log
f=diag.log
grep -qs '... failed$' $f && \
echo && \