Make tests less verbose
The numeric values of the labels aren't of value when inspecting test results. For this reason, it makes sense to put them behind the verbose flag to make test framework debugging happen purpose.
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "labels_table.h"
|
#include "labels_table.h"
|
||||||
|
#include "testconnections.h"
|
||||||
|
|
||||||
std::string get_mdbci_lables(const char *labels_string)
|
std::string get_mdbci_lables(const char *labels_string)
|
||||||
{
|
{
|
||||||
@ -9,12 +10,20 @@ std::string get_mdbci_lables(const char *labels_string)
|
|||||||
|
|
||||||
for (size_t i = 0; i < sizeof(labels_table) / sizeof(labels_table_t); i++)
|
for (size_t i = 0; i < sizeof(labels_table) / sizeof(labels_table_t); i++)
|
||||||
{
|
{
|
||||||
printf("%lu\t %s\n", i, labels_table[i].test_label);
|
if (TestConnections::verbose)
|
||||||
|
{
|
||||||
|
printf("%lu\t %s\n", i, labels_table[i].test_label);
|
||||||
|
}
|
||||||
|
|
||||||
if (strstr(labels_string, labels_table[i].test_label))
|
if (strstr(labels_string, labels_table[i].test_label))
|
||||||
{
|
{
|
||||||
mdbci_labels += "," + std::string(labels_table[i].mdbci_label);
|
mdbci_labels += "," + std::string(labels_table[i].mdbci_label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("mdbci labels %s\n", mdbci_labels.c_str());
|
|
||||||
|
if (TestConnections::verbose)
|
||||||
|
{
|
||||||
|
printf("mdbci labels %s\n", mdbci_labels.c_str());
|
||||||
|
}
|
||||||
return mdbci_labels;
|
return mdbci_labels;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,6 +168,11 @@ int Nodes::ssh_node(int node, const char* ssh, bool sudo)
|
|||||||
verbose ? "" : " > /dev/null");
|
verbose ? "" : " > /dev/null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
{
|
||||||
|
std::cout << ssh << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
int rc = 1;
|
int rc = 1;
|
||||||
FILE* in = popen(cmd, "w");
|
FILE* in = popen(cmd, "w");
|
||||||
|
|
||||||
|
|||||||
@ -107,6 +107,8 @@ void TestConnections::restart_galera(bool value)
|
|||||||
maxscale::restart_galera = value;
|
maxscale::restart_galera = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TestConnections::verbose = false;
|
||||||
|
|
||||||
TestConnections::TestConnections(int argc, char* argv[])
|
TestConnections::TestConnections(int argc, char* argv[])
|
||||||
: enable_timeouts(true)
|
: enable_timeouts(true)
|
||||||
, global_result(0)
|
, global_result(0)
|
||||||
@ -114,7 +116,6 @@ TestConnections::TestConnections(int argc, char* argv[])
|
|||||||
, local_maxscale(false)
|
, local_maxscale(false)
|
||||||
, no_backend_log_copy(false)
|
, no_backend_log_copy(false)
|
||||||
, no_maxscale_log_copy(false)
|
, no_maxscale_log_copy(false)
|
||||||
, verbose(false)
|
|
||||||
, smoke(true)
|
, smoke(true)
|
||||||
, binlog_cmd_option(0)
|
, binlog_cmd_option(0)
|
||||||
, ssl(false)
|
, ssl(false)
|
||||||
@ -288,7 +289,7 @@ TestConnections::TestConnections(int argc, char* argv[])
|
|||||||
mdbci_call_needed = true;
|
mdbci_call_needed = true;
|
||||||
tprintf("Machines with label '%s' are not running, MDBCI UP call is needed", label.c_str());
|
tprintf("Machines with label '%s' are not running, MDBCI UP call is needed", label.c_str());
|
||||||
}
|
}
|
||||||
else
|
else if (verbose)
|
||||||
{
|
{
|
||||||
tprintf("Machines with label '%s' are running, MDBCI UP call is not needed", label.c_str());
|
tprintf("Machines with label '%s' are running, MDBCI UP call is not needed", label.c_str());
|
||||||
}
|
}
|
||||||
@ -306,13 +307,19 @@ TestConnections::TestConnections(int argc, char* argv[])
|
|||||||
if (mdbci_labels.find(std::string("REPL_BACKEND")) == std::string::npos)
|
if (mdbci_labels.find(std::string("REPL_BACKEND")) == std::string::npos)
|
||||||
{
|
{
|
||||||
no_repl = true;
|
no_repl = true;
|
||||||
tprintf("No need to use Master/Slave");
|
if (verbose)
|
||||||
|
{
|
||||||
|
tprintf("No need to use Master/Slave");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mdbci_labels.find(std::string("GALERA_BACKEND")) == std::string::npos)
|
if (mdbci_labels.find(std::string("GALERA_BACKEND")) == std::string::npos)
|
||||||
{
|
{
|
||||||
no_galera = true;
|
no_galera = true;
|
||||||
tprintf("No need to use Galera");
|
if (verbose)
|
||||||
|
{
|
||||||
|
tprintf("No need to use Galera");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get_logs_command = (char *) malloc(strlen(test_dir) + 14);
|
get_logs_command = (char *) malloc(strlen(test_dir) + 14);
|
||||||
|
|||||||
@ -186,7 +186,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief verbose if true more printing activated
|
* @brief verbose if true more printing activated
|
||||||
*/
|
*/
|
||||||
bool verbose;
|
static bool verbose;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief smoke if true all tests are executed in quick mode
|
* @brief smoke if true all tests are executed in quick mode
|
||||||
|
|||||||
Reference in New Issue
Block a user