From 7394f03cd9f1d8f029e2e1dbd19bb547e25fdc8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 7 Aug 2018 11:42:17 +0300 Subject: [PATCH] Exit with failure if coredump is found in destructor If the test would otherwise succeed but a coredump is found when the logs are copied in the destructor, the test would pass. To prevent this, the destructor should always exit with a non-zero status when it detects an error. --- maxscale-system-test/testconnections.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index e141d6f63..1f31d8c68 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -363,6 +363,12 @@ TestConnections::~TestConnections() { delete galera; } + + if (global_result) + { + // This causes the test to fail if a core dump is found + exit(1); + } } void TestConnections::report_result(const char *format, va_list argp)