Allow programatic control of galera restarting

If a test program needs other than the default Galera config
(e.g. log_slave_updates enabled), then it should be able to
programmatically cause galera to be restarted as part of the
TestConnections construction.
This commit is contained in:
Johan Wikman
2018-09-12 08:41:52 +03:00
parent 9b0f016aba
commit d881630204
2 changed files with 20 additions and 3 deletions

View File

@ -24,6 +24,7 @@ static bool check_nodes = true;
static bool manual_debug = false;
static std::string required_repl_version;
static std::string required_galera_version;
static bool restart_galera = false;
}
static void signal_set(int sig, void (* handler)(int))
@ -66,6 +67,11 @@ void TestConnections::require_galera_version(const char* version)
maxscale::required_galera_version = version;
}
void TestConnections::restart_galera(bool value)
{
maxscale::restart_galera = value;
}
TestConnections::TestConnections(int argc, char* argv[])
: enable_timeouts(true)
, global_result(0)
@ -123,7 +129,6 @@ TestConnections::TestConnections(int argc, char* argv[])
int c;
int option_index = 0;
bool restart_galera = false;
while ((c = getopt_long(argc, argv, "hvnqsirgzyl", long_options, &option_index)) != -1)
{
@ -174,7 +179,7 @@ TestConnections::TestConnections(int argc, char* argv[])
case 'g':
printf("Restarting Galera setup\n");
restart_galera = true;
maxscale::restart_galera = true;
break;
case 'z':
@ -280,7 +285,7 @@ TestConnections::TestConnections(int argc, char* argv[])
}
}
if ((restart_galera) && (!no_galera))
if ((maxscale::restart_galera) && (!no_galera))
{
galera->stop_nodes();
galera->start_replication();