use testgalera and testaurora to build monitor tests from root folder

pull/2439/head
Valentin Rakush 6 years ago
parent 4c2a1d9ea5
commit 724ddc14eb

@ -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

@ -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)\"

@ -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<max_num_galera_servers+11 ; i++) {
s += "127.1." + std::to_string(j) + "." + std::to_string(i) + ":3306";
if ( j!=3 || (j==3 && i<max_num_galera_servers+11-1) ) {
s += ";";
}
}
}
}
void SQLite3_Server::init_aurora_ifaces_string(std::string& s) {
if(!s.empty())
s += ";";

@ -72,27 +72,6 @@ static bool init_tap=false;
} 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<max_num_aurora_servers+11 ; i++) {
s += "127.0." + std::to_string(j) + "." + std::to_string(i) + ":3306";
if ( j!=3 || (j==3 && i<max_num_aurora_servers+11-1) ) {
s += ";";
}
}
}
}
void SQLite3_Server::init_galera_ifaces_string(std::string& s) {
if(!s.empty())
s += ";";

@ -73,27 +73,6 @@ static std::vector<int> 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<max_num_aurora_servers+11 ; i++) {
s += "127.0." + std::to_string(j) + "." + std::to_string(i) + ":3306";
if ( j!=3 || (j==3 && i<max_num_aurora_servers+11-1) ) {
s += ";";
}
}
}
}
void SQLite3_Server::init_galera_ifaces_string(std::string& s) {
if(!s.empty())
s += ";";

Loading…
Cancel
Save