From 724ddc14eba0df30caa03d07fc66df60927002ca Mon Sep 17 00:00:00 2001 From: Valentin Rakush Date: Wed, 22 Jan 2020 20:41:47 +0000 Subject: [PATCH] use testgalera and testaurora to build monitor tests from root folder --- Makefile | 4 ++++ test/tap/tests/Makefile | 9 +++++---- test/tap/tests/aurora.cpp | 20 ------------------- test/tap/tests/galera_1_timeout_count.cpp | 21 -------------------- test/tap/tests/galera_2_timeout_no_count.cpp | 21 -------------------- 5 files changed, 9 insertions(+), 66 deletions(-) diff --git a/Makefile b/Makefile index 9b936eaa7..9a485a79f 100644 --- a/Makefile +++ b/Makefile @@ -44,9 +44,13 @@ debug: build_deps_debug build_lib_debug build_src_debug .PHONY: testaurora testaurora: build_deps_debug build_lib_testaurora build_src_testaurora + cd test/tap && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA" CC=${CC} CXX=${CXX} ${MAKE} + cd test/tap/tests && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA" CC=${CC} CXX=${CXX} ${MAKE} $(MAKECMDGOALS) .PHONY: testgalera testgalera: build_deps_debug build_lib_testgalera build_src_testgalera + cd test/tap && OPTZ="${O0} -ggdb -DDEBUG -DTEST_GALERA" CC=${CC} CXX=${CXX} ${MAKE} + cd test/tap/tests && OPTZ="${O0} -ggdb -DDEBUG -DTEST_GALERA" CC=${CC} CXX=${CXX} ${MAKE} $(MAKECMDGOALS) .PHONY: testgrouprep testgrouprep: build_deps_debug build_lib_testgrouprep build_src_testgrouprep diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 5e1289438..0a182e69b 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -81,7 +81,8 @@ OPT=-O2 SRC=basic-t.cpp set_character_set-t.cpp charset_unsigned_int-t.cpp select_config_file-t.cpp sqlite3-t.cpp galera_1_timeout_count.cpp galera_2_timeout_no_count.cpp aurora.cpp tests: basic-t set_character_set-t charset_unsigned_int-t select_config_file-t sqlite3-t -tests-monitor: galera_1_timeout_count galera_2_timeout_no_count aurora +testgalera: galera_1_timeout_count galera_2_timeout_no_count +testaurora: aurora sqlite3-t: $(TAP_LIBDIR)/libtap.a sqlite3-t.cpp g++ sqlite3-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) ../../../lib/libproxysql.a $(MYLIBS) -lpthread -ldl -std=c++11 -ltap -o sqlite3-t @@ -99,11 +100,11 @@ select_config_file-t: select_config_file-t.cpp $(TAP_LIBDIR)/libtap.a g++ select_config_file-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 -ltap -ldl $(MYLIBS) -o select_config_file-t galera_1_timeout_count: galera_1_timeout_count.cpp $(TAP_LIBDIR)/libtap.a - g++ -DTEST_GALERA -DTEST_AURORA -DTEST_GROUPREP -DDEBUG galera_1_timeout_count.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o galera_1_timeout_count -DGITVERSION=\"$(GIT_VERSION)\" + g++ -DTEST_GALERA -DDEBUG galera_1_timeout_count.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o galera_1_timeout_count -DGITVERSION=\"$(GIT_VERSION)\" galera_2_timeout_no_count: galera_2_timeout_no_count.cpp $(TAP_LIBDIR)/libtap.a - g++ -DTEST_GALERA -DTEST_AURORA -DTEST_GROUPREP -DDEBUG galera_2_timeout_no_count.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o galera_2_timeout_no_count -DGITVERSION=\"$(GIT_VERSION)\" + g++ -DTEST_GALERA -DDEBUG galera_2_timeout_no_count.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o galera_2_timeout_no_count -DGITVERSION=\"$(GIT_VERSION)\" aurora: aurora.cpp $(TAP_LIBDIR)/libtap.a - g++ -DTEST_GALERA -DTEST_AURORA -DTEST_GROUPREP -DDEBUG aurora.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o aurora -DGITVERSION=\"$(GIT_VERSION)\" + g++ -DTEST_AURORA -DDEBUG aurora.cpp ../tap/SQLite3_Server.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(OBJ) $(MYLIBS) -ltap -ldl -o aurora -DGITVERSION=\"$(GIT_VERSION)\" diff --git a/test/tap/tests/aurora.cpp b/test/tap/tests/aurora.cpp index 7daaa34e2..f35212e83 100644 --- a/test/tap/tests/aurora.cpp +++ b/test/tap/tests/aurora.cpp @@ -61,26 +61,6 @@ extern SQLite3_Server *GloSQLite3Server; } while (rc==SQLITE_LOCKED || rc==SQLITE_BUSY);\ } while (0) -void SQLite3_Server::init_galera_ifaces_string(std::string& s) { - if(!s.empty()) - s += ";"; - pthread_mutex_init(&galera_mutex,NULL); - unsigned int ngs = time(NULL); - ngs = ngs % 3; // range - ngs += 5; // min - max_num_galera_servers = 1; // hypothetical maximum number of nodes - for (unsigned int j=1; j<4; j++) { - //cur_aurora_writer[j-1] = 0; - num_galera_servers[j-1] = ngs; - for (unsigned int i=11; i timeouts; } while (rc==SQLITE_LOCKED || rc==SQLITE_BUSY);\ } while (0) - -void SQLite3_Server::init_aurora_ifaces_string(std::string& s) { - if(!s.empty()) - s += ";"; - pthread_mutex_init(&aurora_mutex,NULL); - unsigned int nas = time(NULL); - nas = nas % 3; // range - nas += 4; // min - max_num_aurora_servers = 10; // hypothetical maximum number of nodes - for (unsigned int j=1; j<4; j++) { - cur_aurora_writer[j-1] = 0; - num_aurora_servers[j-1] = nas; - for (unsigned int i=11; i