From 13d0c818f34487bb27bc81c273c846d25df502bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 8 Oct 2018 10:04:01 +0300 Subject: [PATCH] Stop keepalived after the test Stopping keepalived on all nodes prevents it from interfering with tests run after it. --- maxscale-system-test/keepalived.cpp | 1 + maxscale-system-test/keepalived_func.cpp | 8 ++++++++ maxscale-system-test/keepalived_func.h | 1 + maxscale-system-test/keepalived_masterdown.cpp | 1 + 4 files changed, 11 insertions(+) diff --git a/maxscale-system-test/keepalived.cpp b/maxscale-system-test/keepalived.cpp index 9cbd99c5d..236e9c6cf 100644 --- a/maxscale-system-test/keepalived.cpp +++ b/maxscale-system-test/keepalived.cpp @@ -96,6 +96,7 @@ int main(int argc, char* argv[]) Test->add_result(false, "Failover did not happen"); } + stop_keepalived(Test); int rval = Test->global_result; delete Test; return rval; diff --git a/maxscale-system-test/keepalived_func.cpp b/maxscale-system-test/keepalived_func.cpp index 31cde1e33..4088e7820 100644 --- a/maxscale-system-test/keepalived_func.cpp +++ b/maxscale-system-test/keepalived_func.cpp @@ -65,3 +65,11 @@ void configure_keepalived(TestConnections* Test, char* keepalived_file) Test->maxscales->ssh_node(i, "sudo service keepalived restart", true); } } + +void stop_keepalived(TestConnections* Test) +{ + for (i = 0; i < Test->maxscales->N; i++) + { + Test->maxscales->ssh_node(i, "sudo service keepalived stop", true); + } +} diff --git a/maxscale-system-test/keepalived_func.h b/maxscale-system-test/keepalived_func.h index 13fc3487e..016c84c1c 100644 --- a/maxscale-system-test/keepalived_func.h +++ b/maxscale-system-test/keepalived_func.h @@ -8,5 +8,6 @@ char virtual_ip[16]; char* print_version_string(TestConnections* Test); void configure_keepalived(TestConnections* Test, char* keepalived_file); +void stop_keepalived(TestConnections* Test); #endif // KEEPALIVED_FUNC_H diff --git a/maxscale-system-test/keepalived_masterdown.cpp b/maxscale-system-test/keepalived_masterdown.cpp index 8f3db2759..f1a2c1552 100644 --- a/maxscale-system-test/keepalived_masterdown.cpp +++ b/maxscale-system-test/keepalived_masterdown.cpp @@ -182,6 +182,7 @@ int main(int argc, char* argv[]) // Test->repl->require_gtid(false); // Test->repl->start_replication(); + stop_keepalived(Test); int rval = Test->global_result; delete Test; return rval;