Update older mysqlmon tests

Some of the older tests expected results that didn't make much sense. The
mxs1643_extra_events test should expect the master to devolve into the
Running state when it is set into read-only. This is understandable as a
set of servers consisting only of slaves is rather disorienting.

In mxs1678_relay_master breaking the replication of the relay master
devolves it into the Running state as well as all slaves replicating from
it. This is a better result as in a real-life scenario only the valid and
up-to-date slaves would be used.
This commit is contained in:
Markus Mäkelä 2018-07-12 14:47:38 +03:00
parent bded99aea3
commit 0808f66aaa
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 7 additions and 5 deletions

View File

@ -15,8 +15,8 @@ int main(int argc, char** argv)
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=ON");
test.maxscales->wait_for_monitor();
test.tprintf("Check that the current master now has the slave label");
test.check_log_err(0, "[Master, Running] -> [Running]", false);
test.check_log_err(0, "[Master, Running] -> [Slave, Running]", true);
test.check_log_err(0, "[Master, Running] -> [Running]", true);
test.check_log_err(0, "[Master, Running] -> [Slave, Running]", false);
test.maxscales->ssh_node_f(0, true, "truncate -s 0 /var/log/maxscale/maxscale.log");
// Check that the Master and Slave status aren't both set
@ -24,7 +24,8 @@ int main(int argc, char** argv)
test.maxscales->wait_for_monitor();
test.tprintf("Check that the new master doesn't have both slave and master labels");
test.check_log_err(0, "[Slave, Running] -> [Master, Slave, Running]", false);
test.check_log_err(0, "[Slave, Running] -> [Master, Running]", true);
test.check_log_err(0, "[Slave, Running] -> [Master, Running]", false);
test.check_log_err(0, "[Running] -> [Master, Running]", true);
return test.global_result;
}

View File

@ -19,6 +19,7 @@ int main(int argc, char** argv)
StringSet master = {"Master", "Running"};
StringSet slave = {"Slave", "Running"};
StringSet running = {"Running"};
StringSet relay_master = {"Relay Master", "Slave", "Running"};
StringSet relay_master_only = {"Relay Master", "Running"};
@ -42,8 +43,8 @@ int main(int argc, char** argv)
free(output);
test.add_result(test.maxscales->get_server_status("server1") != master, "server1 is not a master");
test.add_result(test.maxscales->get_server_status( "server2") != slave, "server2 is not a slave");
test.add_result(test.maxscales->get_server_status("server3") != relay_master_only, "server3 is not a relay master");
test.add_result(test.maxscales->get_server_status("server4") != slave, "server4 is not a slave");
test.add_result(test.maxscales->get_server_status("server3") != running, "server3 is not only running");
test.add_result(test.maxscales->get_server_status("server4") != running, "server4 is not only running");
test.repl->fix_replication();
return test.global_result;