From 64ccb67897a894a365380cbd2e6ac21aca528f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Mar 2018 14:46:41 +0200 Subject: [PATCH] Mark crashing tests as failed If a test generates a core dump, it is marked as a failure. --- maxscale-system-test/copy_logs.sh | 4 ++++ maxscale-system-test/testconnections.cpp | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/maxscale-system-test/copy_logs.sh b/maxscale-system-test/copy_logs.sh index c573d3c98..0f3bfbfa6 100755 --- a/maxscale-system-test/copy_logs.sh +++ b/maxscale-system-test/copy_logs.sh @@ -51,3 +51,7 @@ else rsync -a --no-o --no-g LOGS $logs_publish_dir fi +for i in `find $logs_dir -name 'core*'` +do + test -e $i && echo "Test failed: core files generated" && exit 1 +done diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index 7023bf08b..a02dd1c81 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -827,16 +827,15 @@ int TestConnections::copy_all_logs() sprintf(str, "%s/copy_logs.sh %s", test_dir, test_name); tprintf("Executing %s\n", str); + if (system(str) != 0) { tprintf("copy_logs.sh executing FAILED!\n"); - return 1; - } - else - { - tprintf("copy_logs.sh OK!\n"); - return 0; + exit(1); } + + tprintf("copy_logs.sh OK!\n"); + return 0; } int TestConnections::copy_all_logs_periodic()