Fix verify_master_failure

The test expected the wrong error message to be in the log. To better cope
with changes in the text, the test now uses a regular expression to do the
matching.
This commit is contained in:
Markus Mäkelä
2017-11-13 15:47:25 +02:00
parent f41111b4bd
commit fca11f992a
3 changed files with 35 additions and 2 deletions

View File

@ -1183,6 +1183,21 @@ int TestConnections::start_mm()
return global_result;
}
bool TestConnections::log_matches(const char* pattern)
{
return ssh_maxscale(true, "grep '%s' /var/log/maxscale/maxscale*.log", pattern) == 0;
}
void TestConnections::log_includes(const char* pattern)
{
add_result(!log_matches(pattern), "Log does not match pattern '%s'", pattern);
}
void TestConnections::log_excludes(const char* pattern)
{
add_result(log_matches(pattern), "Log matches pattern '%s'", pattern);
}
void TestConnections::check_log_err(const char * err_msg, bool expected)
{