From a4dc99d07c6793b5a04c731c7c1f2ae9c0d2f710 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 9 Jan 2018 10:43:26 +0200 Subject: [PATCH] Reset situation after test If node00 is not the master when a test is started, the cleanup performed by TestConnections takes considerable time. By restoring the sitation back to normal before ending the test, the startup time of the next test can be shortened significantly. --- maxscale-system-test/mysqlmon_switchover.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/maxscale-system-test/mysqlmon_switchover.cpp b/maxscale-system-test/mysqlmon_switchover.cpp index acc1acfee..14bea8d7a 100644 --- a/maxscale-system-test/mysqlmon_switchover.cpp +++ b/maxscale-system-test/mysqlmon_switchover.cpp @@ -145,7 +145,8 @@ void run(TestConnections& test) test.repl->sync_slaves(); cout << "\nTrying to do manual switchover to server2" << endl; - const char* zCommand = "call command mysqlmon switchover MySQL-Monitor server2 server1"; + const char* zCommand; + zCommand = "call command mysqlmon switchover MySQL-Monitor server2 server1"; test.maxscales->execute_maxadmin_command_print(0, (char*)zCommand); sleep(5); @@ -154,6 +155,19 @@ void run(TestConnections& test) expect(test, "server2", "Master", "Running"); expect(test, "server3", "Slave", "Running"); expect(test, "server4", "Slave", "Running"); + + cout << "\nResetting situation." << endl; + + cout << "\nTrying to do manual switchover to server1" << endl; + zCommand = "call command mysqlmon switchover MySQL-Monitor server1 server2"; + test.maxscales->execute_maxadmin_command_print(0, (char*)zCommand); + + sleep(5); + + expect(test, "server1", "Master", "Running"); + expect(test, "server2", "Slave", "Running"); + expect(test, "server3", "Slave", "Running"); + expect(test, "server4", "Slave", "Running"); } }