MXS-2644 Move ci setup from constructor to setup() function

By moving the setting up of the test environment from the constructor
to a separate setup()-function, it is possible to introduce virtual
functions and make it easier to do things differently depending on
whether the backend is MariaDB, Galera och Clustrix.
This commit is contained in:
Johan Wikman
2019-08-21 13:16:06 +03:00
parent 52df969e13
commit 855b8d876a
7 changed files with 68 additions and 36 deletions

View File

@ -371,6 +371,7 @@ TestConnections::TestConnections(int argc, char* argv[])
if (!no_repl)
{
repl = new Mariadb_nodes("node", test_dir, verbose, network_config);
repl->setup();
repl->use_ipv6 = use_ipv6;
repl->take_snapshot_command = take_snapshot_command;
repl->revert_snapshot_command = revert_snapshot_command;
@ -384,7 +385,7 @@ TestConnections::TestConnections(int argc, char* argv[])
if (!no_galera)
{
galera = new Galera_nodes("galera", test_dir, verbose, network_config);
//galera->use_ipv6 = use_ipv6;
galera->setup();
galera->use_ipv6 = false;
galera->take_snapshot_command = take_snapshot_command;
galera->revert_snapshot_command = revert_snapshot_command;
@ -398,7 +399,7 @@ TestConnections::TestConnections(int argc, char* argv[])
if (!no_clustrix)
{
clustrix = new Clustrix_nodes("clustrix", test_dir, verbose, network_config);
//galera->use_ipv6 = use_ipv6;
clustrix->setup();
clustrix->use_ipv6 = false;
clustrix->take_snapshot_command = take_snapshot_command;
clustrix->revert_snapshot_command = revert_snapshot_command;
@ -410,6 +411,7 @@ TestConnections::TestConnections(int argc, char* argv[])
}
maxscales = new Maxscales("maxscale", test_dir, verbose, network_config);
maxscales->setup();
bool maxscale_ok = maxscales->check_nodes();
bool repl_ok = no_repl || repl_future.get();