Merge branch '2.1' into 2.2
This commit is contained in:
@ -258,10 +258,14 @@ void test_connecting(TestConnections& test,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_test(TestConnections& test, const string& ip1, const string& ip2)
|
void run_test(TestConnections& test, const vector<string>& ips)
|
||||||
{
|
{
|
||||||
test.maxscales->connect();
|
test.maxscales->connect();
|
||||||
|
|
||||||
|
string ip1 = ips[0];
|
||||||
|
// If we do not have a proper second IP-address, we'll use an arbitrary one.
|
||||||
|
string ip2 = (ips.size() > 1) ? ips[1] : string("42.42.42.42");
|
||||||
|
|
||||||
string local_ip = get_local_ip(test);
|
string local_ip = get_local_ip(test);
|
||||||
|
|
||||||
const char* zUser1 = "alice";
|
const char* zUser1 = "alice";
|
||||||
@ -297,9 +301,8 @@ void run_test(TestConnections& test, const string& ip1, const string& ip2)
|
|||||||
test.maxscales->disconnect();
|
test.maxscales->disconnect();
|
||||||
test.stop_maxscale();
|
test.stop_maxscale();
|
||||||
|
|
||||||
test.tprintf("\n");
|
if (ips.size() > 1)
|
||||||
test.tprintf("WARNING: Other IP-address not tested, as usable IP-address not available.");
|
{
|
||||||
|
|
||||||
#ifdef USABLE_SECOND_IP_ADDRESS_ON_MAXSCALE_NODE_IS_AVAILABLE
|
#ifdef USABLE_SECOND_IP_ADDRESS_ON_MAXSCALE_NODE_IS_AVAILABLE
|
||||||
test.tprintf("\n");
|
test.tprintf("\n");
|
||||||
test.tprintf("\nTesting with local_address=%s, bob should be able to access, alice not.",
|
test.tprintf("\nTesting with local_address=%s, bob should be able to access, alice not.",
|
||||||
@ -314,7 +317,18 @@ void run_test(TestConnections& test, const string& ip1, const string& ip2)
|
|||||||
|
|
||||||
test.maxscales->disconnect();
|
test.maxscales->disconnect();
|
||||||
test.stop_maxscale();
|
test.stop_maxscale();
|
||||||
|
#else
|
||||||
|
test.tprintf("\n");
|
||||||
|
test.tprintf("WARNING: Other IP-address (%s) not tested, as IP-address currently "
|
||||||
|
"not usable on VM.", ip2.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
test.tprintf("\n");
|
||||||
|
test.tprintf("WARNING: Only one IP-address found on MaxScale node, 'local_address' "
|
||||||
|
"not properly tested.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -326,13 +340,13 @@ int main(int argc, char** argv)
|
|||||||
vector<string> ips;
|
vector<string> ips;
|
||||||
get_maxscale_ips(test, &ips);
|
get_maxscale_ips(test, &ips);
|
||||||
|
|
||||||
if (ips.size() >= 2)
|
if (ips.size() >= 1)
|
||||||
{
|
{
|
||||||
run_test(test, ips[0], ips[1]);
|
run_test(test, ips);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
test.assert(false, "MaxScale node does not have at least two IP-addresses.");
|
test.assert(false, "MaxScale node does not have at least one IP-address.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return test.global_result;
|
return test.global_result;
|
||||||
|
Reference in New Issue
Block a user