From 2c1b3ac733220f10c915eb65d7da8a561ee1e84a Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 3 Mar 2021 10:18:14 +0200 Subject: [PATCH] MXS-3418 Ignore spaces when modifying network config Much better would be to first allow the config to be parsed and only then change the value. --- system-test/maxtest/src/testconnections.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-test/maxtest/src/testconnections.cc b/system-test/maxtest/src/testconnections.cc index fbbafffea..70e7ddc28 100644 --- a/system-test/maxtest/src/testconnections.cc +++ b/system-test/maxtest/src/testconnections.cc @@ -255,11 +255,11 @@ TestConnections::TestConnections(int argc, char* argv[]) m_no_maxscale_log_copy = true; m_local_maxscale = true; - std::regex regex1("maxscale_000_network=[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); + std::regex regex1("maxscale_000_network[\\s]*=[\\s]*[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); std::string replace1("maxscale_000_network=127.0.0.1"); m_network_config = regex_replace(m_network_config, regex1, replace1); - std::regex regex2("maxscale_000_private_ip=[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); + std::regex regex2("maxscale_000_private_ip[\\s]*=[\\s]*[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); std::string replace2("maxscale_000_private_ip=127.0.0.1"); m_network_config = regex_replace(m_network_config, regex2, replace2); }