Fix test build failures with GCC 8
GCC 8 enables -Werror=return-type by default which combined with -Werror causes the build to fail.
This commit is contained in:
@ -53,7 +53,7 @@ add_library(testcore SHARED testconnections.cpp nodes.cpp mariadb_nodes.cpp maxs
|
|||||||
blob_test.cpp keepalived_func.cpp
|
blob_test.cpp keepalived_func.cpp
|
||||||
# Include the CDC connector in the core library
|
# Include the CDC connector in the core library
|
||||||
${CMAKE_SOURCE_DIR}/../connectors/cdc-connector/cdc_connector.cpp)
|
${CMAKE_SOURCE_DIR}/../connectors/cdc-connector/cdc_connector.cpp)
|
||||||
target_link_libraries(testcore ${MYSQL_CLIENT} ${JANSSON_LIBRARIES} z nsl m pthread ssl dl rt crypto crypt)
|
target_link_libraries(testcore ${MYSQL_CLIENT} ${JANSSON_LIBRARIES} z m pthread ssl dl rt crypto crypt)
|
||||||
install(TARGETS testcore DESTINATION system-test)
|
install(TARGETS testcore DESTINATION system-test)
|
||||||
add_dependencies(testcore connector-c jansson)
|
add_dependencies(testcore connector-c jansson)
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ const char * setup_slave_gtid =
|
|||||||
MASTER_USE_GTID=Slave_pos";
|
MASTER_USE_GTID=Slave_pos";
|
||||||
|
|
||||||
|
|
||||||
int select_new_master(TestConnections * test)
|
void select_new_master(TestConnections * test)
|
||||||
{
|
{
|
||||||
char log_file[256];
|
char log_file[256];
|
||||||
char log_file_new[256];
|
char log_file_new[256];
|
||||||
@ -265,7 +265,7 @@ int select_new_master(TestConnections * test)
|
|||||||
if (!maxscale_log_file[0] || !maxscale_log_pos[0])
|
if (!maxscale_log_file[0] || !maxscale_log_pos[0])
|
||||||
{
|
{
|
||||||
test->add_result(1, "Failed to query for master status");
|
test->add_result(1, "Failed to query for master status");
|
||||||
return 1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
test->tprintf("Real master file: %s\n", maxscale_log_file);
|
test->tprintf("Real master file: %s\n", maxscale_log_file);
|
||||||
@ -320,7 +320,6 @@ int select_new_master(TestConnections * test)
|
|||||||
test->tprintf("slave started!\n");
|
test->tprintf("slave started!\n");
|
||||||
|
|
||||||
test->repl->close_connections();
|
test->repl->close_connections();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *disconnect_thread( void *ptr )
|
void *disconnect_thread( void *ptr )
|
||||||
|
@ -188,6 +188,8 @@ int check_longblob_data(TestConnections* Test, MYSQL * conn, unsigned long chunk
|
|||||||
mysql_stmt_free_result(stmt);
|
mysql_stmt_free_result(stmt);
|
||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,6 +196,7 @@ int bind_by_row(MYSQL *mysql)
|
|||||||
return show_mysql_error(mysql);
|
return show_mysql_error(mysql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
@ -251,4 +251,6 @@ void *query_thread(void *ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Test->repl->close_connections();
|
Test->repl->close_connections();
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int check_max_conn(int router, int max_conn, TestConnections * Test)
|
void check_max_conn(int router, int max_conn, TestConnections * Test)
|
||||||
{
|
{
|
||||||
MYSQL * conn[max_conn + 1];
|
MYSQL * conn[max_conn + 1];
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ void Mariadb_nodes::close_connections()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Mariadb_nodes::read_env()
|
void Mariadb_nodes::read_env()
|
||||||
{
|
{
|
||||||
char * env;
|
char * env;
|
||||||
char env_name[64];
|
char env_name[64];
|
||||||
@ -207,7 +207,7 @@ int Mariadb_nodes::read_env()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Mariadb_nodes::print_env()
|
void Mariadb_nodes::print_env()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < N; i++)
|
for (int i = 0; i < N; i++)
|
||||||
{
|
{
|
||||||
@ -255,7 +255,7 @@ int Mariadb_nodes::find_master()
|
|||||||
return master_node;
|
return master_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Mariadb_nodes::change_master(int NewMaster, int OldMaster)
|
void Mariadb_nodes::change_master(int NewMaster, int OldMaster)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
//int OldMaster = FindMaster();
|
//int OldMaster = FindMaster();
|
||||||
|
@ -168,14 +168,13 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief reads IP, Ports, sshkeys for every node from enviromental variables as well as number of nodes (N) and User/Password
|
* @brief reads IP, Ports, sshkeys for every node from enviromental variables as well as number of nodes (N) and User/Password
|
||||||
* @return 0
|
|
||||||
*/
|
*/
|
||||||
int read_env();
|
void read_env();
|
||||||
/**
|
/**
|
||||||
* @brief prints all nodes information
|
* @brief prints all nodes information
|
||||||
* @return 0
|
* @return 0
|
||||||
*/
|
*/
|
||||||
int print_env();
|
void print_env();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief find_master Tries to find Master node
|
* @brief find_master Tries to find Master node
|
||||||
@ -186,9 +185,8 @@ public:
|
|||||||
* @brief change_master set a new master node for Master/Slave setup
|
* @brief change_master set a new master node for Master/Slave setup
|
||||||
* @param NewMaster index of new Master node
|
* @param NewMaster index of new Master node
|
||||||
* @param OldMaster index of current Master node
|
* @param OldMaster index of current Master node
|
||||||
* @return 0 in case of success
|
|
||||||
*/
|
*/
|
||||||
int change_master(int NewMaster, int OldMaster);
|
void change_master(int NewMaster, int OldMaster);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief stop_nodes stops mysqld on all nodes
|
* @brief stop_nodes stops mysqld on all nodes
|
||||||
|
@ -298,4 +298,5 @@ int get_x_fl_from_json(char * line, long long int * x1, long long int * fl)
|
|||||||
json_decref(x_json);
|
json_decref(x_json);
|
||||||
json_decref(fl_json);
|
json_decref(fl_json);
|
||||||
json_decref(root);
|
json_decref(root);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ struct TestCase
|
|||||||
std::function<bool (MYSQL*, MYSQL_STMT*, Bind&)> func;
|
std::function<bool (MYSQL*, MYSQL_STMT*, Bind&)> func;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool run_test(TestConnections& test, TestCase test_case)
|
void run_test(TestConnections& test, TestCase test_case)
|
||||||
{
|
{
|
||||||
test.maxscales->connect();
|
test.maxscales->connect();
|
||||||
|
|
||||||
|
@ -94,4 +94,6 @@ void *query_thread1( void *ptr )
|
|||||||
Test->maxscales->execute_maxadmin_command(0, shutdown_cmd);
|
Test->maxscales->execute_maxadmin_command(0, shutdown_cmd);
|
||||||
Test->maxscales->execute_maxadmin_command(0, restart_cmd);
|
Test->maxscales->execute_maxadmin_command(0, restart_cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ void* test_thr(void *data)
|
|||||||
|
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define THREADS 5
|
#define THREADS 5
|
||||||
|
@ -202,6 +202,7 @@ int RDS::destroy_route_tables()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RDS::detach_and_destroy_gw()
|
int RDS::detach_and_destroy_gw()
|
||||||
@ -552,7 +553,7 @@ int RDS::destroy_subnets_group()
|
|||||||
char * result;
|
char * result;
|
||||||
sprintf(cmd, "aws rds delete-db-subnet-group --db-subnet-group-name %s", get_subnetgroup_name());
|
sprintf(cmd, "aws rds delete-db-subnet-group --db-subnet-group-name %s", get_subnetgroup_name());
|
||||||
puts(cmd);
|
puts(cmd);
|
||||||
execute_cmd(cmd, &result);
|
return execute_cmd(cmd, &result);
|
||||||
}
|
}
|
||||||
|
|
||||||
int RDS::create_rds_db(int N)
|
int RDS::create_rds_db(int N)
|
||||||
@ -679,7 +680,7 @@ int RDS::delete_rds_cluster()
|
|||||||
detach_and_destroy_gw();
|
detach_and_destroy_gw();
|
||||||
|
|
||||||
printf("Destroy vpc\n");
|
printf("Destroy vpc\n");
|
||||||
destroy_vpc();
|
return destroy_vpc();
|
||||||
}
|
}
|
||||||
|
|
||||||
int RDS::wait_for_nodes(size_t N)
|
int RDS::wait_for_nodes(size_t N)
|
||||||
|
@ -22,7 +22,7 @@ static std::string required_repl_version;
|
|||||||
static std::string required_galera_version;
|
static std::string required_galera_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int signal_set(int sig, void (*handler)(int))
|
static void signal_set(int sig, void (*handler)(int))
|
||||||
{
|
{
|
||||||
struct sigaction sigact = {};
|
struct sigaction sigact = {};
|
||||||
sigact.sa_handler = handler;
|
sigact.sa_handler = handler;
|
||||||
@ -381,7 +381,7 @@ void TestConnections::assert(bool result, const char *format, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestConnections::read_env()
|
void TestConnections::read_env()
|
||||||
{
|
{
|
||||||
|
|
||||||
char *env;
|
char *env;
|
||||||
@ -497,7 +497,7 @@ int TestConnections::read_env()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestConnections::print_env()
|
void TestConnections::print_env()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
printf("Maxscale IP\t%s\n", maxscales->IP[0]);
|
printf("Maxscale IP\t%s\n", maxscales->IP[0]);
|
||||||
@ -611,7 +611,7 @@ void TestConnections::process_template(int m, const char *template_name, const c
|
|||||||
maxscales->copy_to_node_legacy((char *) "maxscale.cnf", (char *) dest, m);
|
maxscales->copy_to_node_legacy((char *) "maxscale.cnf", (char *) dest, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestConnections::init_maxscales()
|
void TestConnections::init_maxscales()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < maxscales->N; i++)
|
for (int i = 0; i < maxscales->N; i++)
|
||||||
{
|
{
|
||||||
@ -619,7 +619,7 @@ int TestConnections::init_maxscales()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestConnections::init_maxscale(int m)
|
void TestConnections::init_maxscale(int m)
|
||||||
{
|
{
|
||||||
const char * template_name = get_template_name(test_name);
|
const char * template_name = get_template_name(test_name);
|
||||||
|
|
||||||
@ -1598,7 +1598,7 @@ int TestConnections::stop_timeout()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestConnections::tprintf(const char *format, ...)
|
void TestConnections::tprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
timeval t2;
|
timeval t2;
|
||||||
gettimeofday(&t2, NULL);
|
gettimeofday(&t2, NULL);
|
||||||
|
@ -251,28 +251,24 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ReadEnv Reads all Maxscale and Master/Slave and Galera setups info from environmental variables
|
* @brief ReadEnv Reads all Maxscale and Master/Slave and Galera setups info from environmental variables
|
||||||
* @return 0 in case of success
|
|
||||||
*/
|
*/
|
||||||
int read_env();
|
void read_env();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief PrintIP Prints all Maxscale and Master/Slave and Galera setups info
|
* @brief PrintIP Prints all Maxscale and Master/Slave and Galera setups info
|
||||||
* @return 0
|
|
||||||
*/
|
*/
|
||||||
int print_env();
|
void print_env();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief InitMaxscale Copies MaxSclae.cnf and start MaxScale
|
* @brief InitMaxscale Copies MaxSclae.cnf and start MaxScale
|
||||||
* @param m Number of Maxscale node
|
* @param m Number of Maxscale node
|
||||||
* @return 0 if case of success
|
|
||||||
*/
|
*/
|
||||||
int init_maxscale(int m = 0);
|
void init_maxscale(int m = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief InitMaxscale Copies MaxSclae.cnf and start MaxScale on all Maxscale nodes
|
* @brief InitMaxscale Copies MaxSclae.cnf and start MaxScale on all Maxscale nodes
|
||||||
* @return 0 if case of success
|
|
||||||
*/
|
*/
|
||||||
int init_maxscales();
|
void init_maxscales();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief start_binlog configure first node as Master, Second as slave connected to Master and others as slave connected to MaxScale binlog router
|
* @brief start_binlog configure first node as Master, Second as slave connected to Master and others as slave connected to MaxScale binlog router
|
||||||
@ -366,11 +362,9 @@ public:
|
|||||||
int stop_timeout();
|
int stop_timeout();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief printf adds timestam to printf
|
* @brief printf with automatic timestamps
|
||||||
* @param __format
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
int tprintf(const char *format, ...);
|
void tprintf(const char *format, ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creats t1 table, insert data into it and checks if data can be correctly read from all Maxscale services
|
* @brief Creats t1 table, insert data into it and checks if data can be correctly read from all Maxscale services
|
||||||
|
Reference in New Issue
Block a user