Skip tests that cannot be run
If a test requires Galera but it is not available, it is now skipped. All tests that explicitly use the `test.galera` member as well as all tests that use a Galera configuration now require that Galera is present.
This commit is contained in:
@ -5,9 +5,8 @@
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
char server_id[test.galera->N][1024];
|
char server_id[test.repl->N][1024];
|
||||||
|
|
||||||
test.repl->connect();
|
test.repl->connect();
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
test.set_timeout(30);
|
test.set_timeout(30);
|
||||||
|
|||||||
@ -163,6 +163,7 @@ int simple_failover(TestConnections* test)
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* test = new TestConnections(argc, argv);
|
TestConnections* test = new TestConnections(argc, argv);
|
||||||
test->galera->verbose = false;
|
test->galera->verbose = false;
|
||||||
int rval1 = 0;
|
int rval1 = 0;
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
char sql[10240];
|
char sql[10240];
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TestConnections::skip_maxscale_start(true);
|
TestConnections::skip_maxscale_start(true);
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
Test->maxscales->stop_maxscale(0);
|
Test->maxscales->stop_maxscale(0);
|
||||||
Test->set_timeout(60);
|
Test->set_timeout(60);
|
||||||
|
|||||||
@ -61,6 +61,7 @@ void do_test(TestConnections& test, int master, int slave)
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
test.galera->stop_node(2);
|
test.galera->stop_node(2);
|
||||||
test.galera->stop_node(3);
|
test.galera->stop_node(3);
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
|||||||
@ -410,6 +410,7 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
mxb::Log log(MXB_LOG_TARGET_STDOUT);
|
mxb::Log log(MXB_LOG_TARGET_STDOUT);
|
||||||
|
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections::skip_maxscale_start(true);
|
TestConnections::skip_maxscale_start(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
long unsigned iterations = (Test->smoke) ? 1000 : 25000;
|
long unsigned iterations = (Test->smoke) ? 1000 : 25000;
|
||||||
int r = (Test->smoke) ? 1 : 3;
|
int r = (Test->smoke) ? 1 : 3;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ using namespace std;
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
string query = "select 1";
|
string query = "select 1";
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ void query_thread(TestConnections* t)
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections test(argc, argv);
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
int master = test.maxscales->find_master_maxadmin(test.galera);
|
int master = test.maxscales->find_master_maxadmin(test.galera);
|
||||||
|
|||||||
@ -58,6 +58,7 @@ void check_pers_conn(TestConnections* Test, int pers_conn_expected[], char* serv
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
int pers_conn_expected[4];
|
int pers_conn_expected[4];
|
||||||
int galera_pers_conn_expected[4];
|
int galera_pers_conn_expected[4];
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
|
|
||||||
Test->set_timeout(60);
|
Test->set_timeout(60);
|
||||||
|
|||||||
@ -90,6 +90,7 @@ void test_script_monitor(TestConnections* Test, Mariadb_nodes* nodes, char* expe
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
TestConnections::require_galera(true);
|
||||||
TestConnections* Test = new TestConnections(argc, argv);
|
TestConnections* Test = new TestConnections(argc, argv);
|
||||||
Test->set_timeout(100);
|
Test->set_timeout(100);
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
#include "testconnections.h"
|
#include "testconnections.h"
|
||||||
|
|
||||||
using namespace mxb;
|
using namespace mxb;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
namespace maxscale
|
namespace maxscale
|
||||||
{
|
{
|
||||||
@ -27,6 +29,7 @@ static bool manual_debug = false;
|
|||||||
static std::string required_repl_version;
|
static std::string required_repl_version;
|
||||||
static std::string required_galera_version;
|
static std::string required_galera_version;
|
||||||
static bool restart_galera = false;
|
static bool restart_galera = false;
|
||||||
|
static bool require_galera = false;
|
||||||
static bool multiple_maxscales = false;
|
static bool multiple_maxscales = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +86,11 @@ void TestConnections::require_galera_version(const char* version)
|
|||||||
maxscale::required_galera_version = version;
|
maxscale::required_galera_version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestConnections::require_galera(bool value)
|
||||||
|
{
|
||||||
|
maxscale::require_galera = value;
|
||||||
|
}
|
||||||
|
|
||||||
void TestConnections::restart_galera(bool value)
|
void TestConnections::restart_galera(bool value)
|
||||||
{
|
{
|
||||||
maxscale::restart_galera = value;
|
maxscale::restart_galera = value;
|
||||||
@ -249,6 +257,12 @@ TestConnections::TestConnections(int argc, char* argv[])
|
|||||||
test_dir);
|
test_dir);
|
||||||
setenv("ssl_options", ssl_options, 1);
|
setenv("ssl_options", ssl_options, 1);
|
||||||
|
|
||||||
|
if (no_galera && maxscale::require_galera)
|
||||||
|
{
|
||||||
|
cout << "Galera not in use, skipping test" <<endl;
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
repl = new Mariadb_nodes("node", test_dir, verbose);
|
repl = new Mariadb_nodes("node", test_dir, verbose);
|
||||||
if (!no_galera)
|
if (!no_galera)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -263,6 +263,9 @@ public:
|
|||||||
static void require_repl_version(const char* version);
|
static void require_repl_version(const char* version);
|
||||||
static void require_galera_version(const char* version);
|
static void require_galera_version(const char* version);
|
||||||
|
|
||||||
|
/** Require that a backend is present*/
|
||||||
|
static void require_galera(bool value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Specify whether galera should be restarted.
|
* @brief Specify whether galera should be restarted.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user