Stop keepalived after the test

Stopping keepalived on all nodes prevents it from interfering with tests
run after it.
This commit is contained in:
Markus Mäkelä 2018-10-08 10:04:01 +03:00
parent a0d12191da
commit 13d0c818f3
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
4 changed files with 11 additions and 0 deletions

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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

View File

@ -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;