From 760f887566b16ba2e15af384bf8d937f6e6c470e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Jun 2019 08:48:03 +0300 Subject: [PATCH] Skip unnecessary reconfiguration The coredump configuration needs to be done only if nodes were restored or if MaxScale was reinstalled. --- maxscale-system-test/testconnections.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index 18f71be0b..139fa8a55 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -415,9 +415,11 @@ TestConnections::TestConnections(int argc, char* argv[]) bool repl_ok = no_repl || repl_future.get(); bool galera_ok = no_galera || galera_future.get(); bool node_error = !maxscale_ok || !repl_ok || !galera_ok; + bool initialize = false; if (node_error || too_many_maxscales()) { + initialize = true; tprintf("Recreating VMs: %s", node_error ? "node check failed" : "too many maxscales"); if (call_mdbci("--recreate")) @@ -426,16 +428,24 @@ TestConnections::TestConnections(int argc, char* argv[]) } } - if (reinstall_maxscale && reinstall_maxscales()) + if (reinstall_maxscale) { - tprintf("Failed to install Maxscale: target is %s", target); - exit(MDBCI_FAUILT); + initialize = true; + + if (reinstall_maxscales()) + { + tprintf("Failed to install Maxscale: target is %s", target); + exit(MDBCI_FAUILT); + } } - std::string src = std::string(test_dir) + "/mdbci/add_core_cnf.sh"; - maxscales->copy_to_node(0, src.c_str(), maxscales->access_homedir[0]); - maxscales->ssh_node_f(0, true, "%s/add_core_cnf.sh %s", maxscales->access_homedir[0], - verbose ? "verbose" : ""); + if (initialize) + { + std::string src = std::string(test_dir) + "/mdbci/add_core_cnf.sh"; + maxscales->copy_to_node(0, src.c_str(), maxscales->access_homedir[0]); + maxscales->ssh_node_f(0, true, "%s/add_core_cnf.sh %s", maxscales->access_homedir[0], + verbose ? "verbose" : ""); + } maxscales->use_ipv6 = use_ipv6;