Merge branch '2.2' into develop

This commit is contained in:
Johan Wikman
2018-09-10 12:29:00 +03:00
63 changed files with 226 additions and 226 deletions

View File

@ -24,10 +24,10 @@ void alter_readwritesplit(TestConnections& test)
second.connect();
// Check that writes work for both connections
test.assert(first.query("SELECT @@last_insert_id"),
test.expect(first.query("SELECT @@last_insert_id"),
"Write to first connection should work: %s",
first.error());
test.assert(second.query("SELECT @@last_insert_id"),
test.expect(second.query("SELECT @@last_insert_id"),
"Write to second connection should work: %s",
second.error());
@ -36,9 +36,9 @@ void alter_readwritesplit(TestConnections& test)
test.maxscales->wait_for_monitor();
// Check that reads work for the newer connection and fail for the older one
test.assert(!first.query("SELECT 1"),
test.expect(!first.query("SELECT 1"),
"Read to first connection should fail.");
test.assert(second.query("SELECT 1"),
test.expect(second.query("SELECT 1"),
"Read to second connection should work: %s",
second.error());
@ -48,14 +48,14 @@ void alter_readwritesplit(TestConnections& test)
test.maxscales->restart();
third.connect();
test.assert(third.query("SELECT @@last_insert_id"),
test.expect(third.query("SELECT @@last_insert_id"),
"Write to third connection should work: %s",
third.error());
test.repl->block_node(0);
test.maxscales->wait_for_monitor();
test.assert(third.query("SELECT 1"),
test.expect(third.query("SELECT 1"),
"Read to third connection should work: %s",
third.error());
@ -76,7 +76,7 @@ void alter_readconnroute(TestConnections& test)
conn.connect();
Row row = conn.row("SELECT @@server_id");
conn.disconnect();
test.assert(row[0] == master_id,
test.expect(row[0] == master_id,
"First connection should use master: %s != %s",
row[0].c_str(),
master_id.c_str());
@ -89,7 +89,7 @@ void alter_readconnroute(TestConnections& test)
conn.connect();
Row row = conn.row("SELECT @@server_id");
conn.disconnect();
test.assert(row[0] != master_id,
test.expect(row[0] != master_id,
"Second connection should not use master: %s == %s",
row[0].c_str(),
master_id.c_str());
@ -100,22 +100,22 @@ void alter_schemarouter(TestConnections& test)
{
Connection conn = test.maxscales->readconn_slave();
conn.connect();
test.assert(!conn.query("SELECT 1"), "Query before reconfiguration should fail");
test.expect(!conn.query("SELECT 1"), "Query before reconfiguration should fail");
conn.disconnect();
test.check_maxctrl("alter service SchemaRouter ignore_databases_regex '.*'");
conn.connect();
test.assert(conn.query("SELECT 1"), "Query after reconfiguration should work: %s", conn.error());
test.expect(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");
test.assert(rc != 0, "Unknown router parameter should be detected");
test.expect(rc != 0, "Unknown router parameter should be detected");
rc = test.maxscales->ssh_node_f(0, true, "maxctrl alter service RW-Split-Router filters Regex");
test.assert(rc != 0, "Unsupported router parameter should be detected");
test.expect(rc != 0, "Unsupported router parameter should be detected");
}
int main(int argc, char** argv)