Backport no_vm_revert option

The VM revert on test failure was added to 2.1 but it was only disabled in
2.2.
This commit is contained in:
Markus Mäkelä 2017-10-02 10:55:00 +03:00
parent 1772cc9021
commit 6a33e55b6f
3 changed files with 24 additions and 3 deletions

View File

@ -65,3 +65,4 @@ System level tests for MaxScale
|no_nodes_check|if yes backend checks are not executed (needed in case of RDS or similar backend)|
|no_backend_log_copy|if yes logs from backend nodes are not copied (needed in case of RDS or similar backend)|
|no_maxscale_start|Do not start Maxscale automatically|
|no_vm_revert|If true tests do not revert VMs after the test even if test failed|

View File

@ -66,7 +66,8 @@ TestConnections::TestConnections(int argc, char *argv[]):
no_backend_log_copy(false), use_snapshots(false), verbose(false), rwsplit_port(4006),
readconn_master_port(4008), readconn_slave_port(4009), binlog_port(5306),
global_result(0), binlog_cmd_option(0), enable_timeouts(true), use_ipv6(false),
no_galera(false)
no_galera(false),
no_vm_revert(true)
{
signal_set(SIGSEGV, sigfatal_handler);
signal_set(SIGABRT, sigfatal_handler);
@ -303,8 +304,15 @@ TestConnections::~TestConnections()
if (global_result != 0 )
{
tprintf("Reverting snapshot\n");
revert_snapshot((char*) "clean");
if (no_vm_revert)
{
tprintf("no_vm_revert flag is set, not reverting VMs\n");
}
else
{
tprintf("Reverting snapshot\n");
revert_snapshot((char*) "clean");
}
}
delete repl;
@ -551,6 +559,12 @@ int TestConnections::read_env()
{
maxscale::start = false;
}
env = getenv("no_vm_revert");
if ((env != NULL) && ((strcasecmp(env, "no") == 0) || (strcasecmp(env, "false") == 0) ))
{
no_vm_revert = false;
}
}
int TestConnections::print_env()

View File

@ -257,6 +257,12 @@ public:
*/
bool no_galera;
/**
* @brief no_vm_revert If true tests do not revert VMs after the test even if test failed
* (use it for debugging)
*/
bool no_vm_revert;
/**
* @brief ssl_options string with ssl configuration for command line client
*/