diff --git a/maxscale-system-test/binary_ps.cpp b/maxscale-system-test/binary_ps.cpp index 7a9d11ddc..137f903f9 100644 --- a/maxscale-system-test/binary_ps.cpp +++ b/maxscale-system-test/binary_ps.cpp @@ -5,9 +5,8 @@ int main(int argc, char** argv) { - TestConnections test(argc, argv); - char server_id[test.galera->N][1024]; + char server_id[test.repl->N][1024]; test.repl->connect(); diff --git a/maxscale-system-test/bug676.cpp b/maxscale-system-test/bug676.cpp index 9ba6388a5..d3321285c 100644 --- a/maxscale-system-test/bug676.cpp +++ b/maxscale-system-test/bug676.cpp @@ -14,6 +14,7 @@ int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections test(argc, argv); test.set_timeout(30); diff --git a/maxscale-system-test/galera_priority.cpp b/maxscale-system-test/galera_priority.cpp index 37f844814..903849f98 100644 --- a/maxscale-system-test/galera_priority.cpp +++ b/maxscale-system-test/galera_priority.cpp @@ -163,6 +163,7 @@ int simple_failover(TestConnections* test) int main(int argc, char** argv) { + TestConnections::require_galera(true); TestConnections* test = new TestConnections(argc, argv); test->galera->verbose = false; int rval1 = 0; diff --git a/maxscale-system-test/lots_of_rows.cpp b/maxscale-system-test/lots_of_rows.cpp index 99a33bedb..948411e0e 100644 --- a/maxscale-system-test/lots_of_rows.cpp +++ b/maxscale-system-test/lots_of_rows.cpp @@ -11,6 +11,7 @@ int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); char sql[10240]; diff --git a/maxscale-system-test/mxs1110_16mb.cpp b/maxscale-system-test/mxs1110_16mb.cpp index ed73ed21d..a5f3b1fc9 100644 --- a/maxscale-system-test/mxs1110_16mb.cpp +++ b/maxscale-system-test/mxs1110_16mb.cpp @@ -12,6 +12,7 @@ int main(int argc, char* argv[]) { TestConnections::skip_maxscale_start(true); + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); Test->maxscales->stop_maxscale(0); Test->set_timeout(60); diff --git a/maxscale-system-test/mxs1476.cpp b/maxscale-system-test/mxs1476.cpp index b197f867f..a94467c7b 100644 --- a/maxscale-system-test/mxs1476.cpp +++ b/maxscale-system-test/mxs1476.cpp @@ -61,6 +61,7 @@ void do_test(TestConnections& test, int master, int slave) int main(int argc, char** argv) { + TestConnections::require_galera(true); TestConnections test(argc, argv); test.galera->stop_node(2); test.galera->stop_node(3); diff --git a/maxscale-system-test/mxs1751_available_when_donor_crash.cpp b/maxscale-system-test/mxs1751_available_when_donor_crash.cpp index 58aa24856..b1a127776 100644 --- a/maxscale-system-test/mxs1751_available_when_donor_crash.cpp +++ b/maxscale-system-test/mxs1751_available_when_donor_crash.cpp @@ -15,6 +15,7 @@ int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections test(argc, argv); for (int i = 0; i < 2; i++) diff --git a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp index 8063f2ee7..7c7edd571 100644 --- a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp +++ b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp @@ -410,6 +410,7 @@ int main(int argc, char* argv[]) { mxb::Log log(MXB_LOG_TARGET_STDOUT); + TestConnections::require_galera(true); TestConnections::skip_maxscale_start(true); TestConnections test(argc, argv); diff --git a/maxscale-system-test/mxs244_prepared_stmt_loop.cpp b/maxscale-system-test/mxs244_prepared_stmt_loop.cpp index 4bbd3fb62..030776c4a 100644 --- a/maxscale-system-test/mxs244_prepared_stmt_loop.cpp +++ b/maxscale-system-test/mxs244_prepared_stmt_loop.cpp @@ -17,6 +17,7 @@ int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); long unsigned iterations = (Test->smoke) ? 1000 : 25000; int r = (Test->smoke) ? 1 : 3; diff --git a/maxscale-system-test/mxs314.cpp b/maxscale-system-test/mxs314.cpp index f32ebe52d..659b37e98 100644 --- a/maxscale-system-test/mxs314.cpp +++ b/maxscale-system-test/mxs314.cpp @@ -10,6 +10,7 @@ using namespace std; int main(int argc, char** argv) { + TestConnections::require_galera(true); TestConnections test(argc, argv); string query = "select 1"; diff --git a/maxscale-system-test/mxs564_big_dump.cpp b/maxscale-system-test/mxs564_big_dump.cpp index e21606b05..b906908b2 100644 --- a/maxscale-system-test/mxs564_big_dump.cpp +++ b/maxscale-system-test/mxs564_big_dump.cpp @@ -46,6 +46,7 @@ void query_thread(TestConnections* t) int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections test(argc, argv); int master = test.maxscales->find_master_maxadmin(test.galera); diff --git a/maxscale-system-test/pers_01.cpp b/maxscale-system-test/pers_01.cpp index fb7fad5fe..ec25af5cf 100644 --- a/maxscale-system-test/pers_01.cpp +++ b/maxscale-system-test/pers_01.cpp @@ -58,6 +58,7 @@ void check_pers_conn(TestConnections* Test, int pers_conn_expected[], char* serv int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); int pers_conn_expected[4]; int galera_pers_conn_expected[4]; diff --git a/maxscale-system-test/pers_02.cpp b/maxscale-system-test/pers_02.cpp index 5115fa610..84c9f07ed 100644 --- a/maxscale-system-test/pers_02.cpp +++ b/maxscale-system-test/pers_02.cpp @@ -18,6 +18,7 @@ int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); Test->set_timeout(60); diff --git a/maxscale-system-test/script.cpp b/maxscale-system-test/script.cpp index fb48db184..8b563ecc8 100644 --- a/maxscale-system-test/script.cpp +++ b/maxscale-system-test/script.cpp @@ -90,6 +90,7 @@ void test_script_monitor(TestConnections* Test, Mariadb_nodes* nodes, char* expe int main(int argc, char* argv[]) { + TestConnections::require_galera(true); TestConnections* Test = new TestConnections(argc, argv); Test->set_timeout(100); diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index 30687a60e..86e95e080 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -17,6 +17,8 @@ #include "testconnections.h" using namespace mxb; +using std::cout; +using std::endl; namespace maxscale { @@ -27,6 +29,7 @@ static bool manual_debug = false; static std::string required_repl_version; static std::string required_galera_version; static bool restart_galera = false; +static bool require_galera = false; static bool multiple_maxscales = false; } @@ -83,6 +86,11 @@ void TestConnections::require_galera_version(const char* version) maxscale::required_galera_version = version; } +void TestConnections::require_galera(bool value) +{ + maxscale::require_galera = value; +} + void TestConnections::restart_galera(bool value) { maxscale::restart_galera = value; @@ -249,6 +257,12 @@ TestConnections::TestConnections(int argc, char* argv[]) test_dir); setenv("ssl_options", ssl_options, 1); + if (no_galera && maxscale::require_galera) + { + cout << "Galera not in use, skipping test" <