Add test case for ignore_external_masters + failover

The test checks that failover works even when the master of the monitored
cluster is a slave to an external masters. The test also verifies that the
servers do not get unexpected status labels.
This commit is contained in:
Markus Mäkelä
2018-02-07 00:41:49 +02:00
parent 8bf756ca56
commit 6a1aba70e7
9 changed files with 241 additions and 34 deletions

View File

@ -6,6 +6,7 @@
#include <time.h>
#include <signal.h>
#include <execinfo.h>
#include <sstream>
#include "mariadb_func.h"
#include "maxadmin_operations.h"
@ -1884,3 +1885,25 @@ bool TestConnections::test_bad_config(int m, const char *config)
return maxscales->ssh_node(m, "cp maxscale.cnf /etc/maxscale.cnf; service maxscale stop; "
"maxscale -U maxscale -lstdout &> /dev/null && sleep 1 && pkill -9 maxscale", false) == 0;
}
std::string dump_status(const StringSet& current, const StringSet& expected)
{
std::stringstream ss;
ss << "Current status: (";
for (const auto& a: current)
{
ss << a << ",";
}
ss << ") Expected status: (";
for (const auto& a: expected)
{
ss << a << ",";
}
ss << ")";
return ss.str();
}