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

@ -14,7 +14,12 @@ typedef std::set<std::string> StringSet;
class Nodes
{
public:
Nodes();
/**
* Sets up the nodes. *Must* be called before instance is used.
*
* @return True, if the instance could be setup, false otherwise.
*/
virtual bool setup() = 0;
char * IP[256];
/**
@ -31,7 +36,7 @@ public:
* @brief use_ipv6 If true IPv6 addresses will be used to connect Maxscale and backed
* Also IPv6 addresses go to maxscale.cnf
*/
bool use_ipv6;
bool use_ipv6 = false;
/**
* @brief Path to ssh key for every backend node
@ -205,6 +210,11 @@ public:
*/
int stop_vm(int node);
protected:
Nodes(const char* pref,
const std::string& network_config,
bool verbose);
private:
bool check_node_ssh(int node);
};