Add schemarouter reconfiguration test

Extended the alter_router test to check that modifications to schemarouter
are processed correctly.
This commit is contained in:
Markus Mäkelä
2018-07-09 14:20:18 +03:00
parent 5903e194a7
commit 151c7e19f4
3 changed files with 105 additions and 1 deletions

View File

@ -88,6 +88,21 @@ void alter_readconnroute(TestConnections& test)
}
}
void alter_schemarouter(TestConnections& test)
{
Connection conn = test.maxscales->readconn_slave();
conn.connect();
test.assert(!conn.query("SELECT 1"), "Query before reconfiguration should fail");
conn.disconnect();
int rc = test.maxscales->ssh_node_f(0, true, "maxctrl alter service SchemaRouter ignore_databases_regex '.*'");
test.assert(rc == 0, "Schemarouter alteration should work");
conn.connect();
test.assert(conn.query("SELECT 1"), "Query after reconfiguration should work: %s", conn.error());
conn.disconnect();
}
void alter_unsupported(TestConnections& test)
{
int rc = test.maxscales->ssh_node_f(0, true, "maxctrl alter service RW-Split-Router unknown parameter");
@ -104,6 +119,7 @@ int main(int argc, char** argv)
{
TEST(alter_readwritesplit),
TEST(alter_readconnroute),
TEST(alter_schemarouter),
TEST(alter_unsupported)
};