Merge branch '2.2' into develop
This commit is contained in:
@ -1058,5 +1058,9 @@ add_test_executable(mxs1985_kill_hang.cpp mxs1985_kill_hang replication LABELS R
|
||||
# https://jira.mariadb.org/browse/MXS-1113
|
||||
add_test_executable(mxs1113_schemarouter_ps.cpp mxs1113_schemarouter_ps mxs1113_schemarouter_ps LABELS schemarouter BREAKS_REPL)
|
||||
|
||||
# MXS-2037: Wildcards not working with source in Named Server Filter
|
||||
# https://jira.mariadb.org/browse/MXS-2037
|
||||
add_test_executable(mxs2037_namedserver_wildcards.cpp mxs2037_namedserver_wildcards mxs2037_namedserver_wildcards LABELS namedserverfilter LIGHT REPL_BACKEND)
|
||||
|
||||
|
||||
configure_file(templates.h.in ${CMAKE_CURRENT_BINARY_DIR}/templates.h @ONLY)
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
[maxscale]
|
||||
threads=###threads###
|
||||
log_warning=1
|
||||
|
||||
[namedserverfilter]
|
||||
type=filter
|
||||
module=namedserverfilter
|
||||
match01=SELECT
|
||||
target01=server1
|
||||
source=127.%.%.%
|
||||
|
||||
[MySQL Monitor]
|
||||
type=monitor
|
||||
module=mysqlmon
|
||||
###repl51###
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
monitor_interval=1000
|
||||
|
||||
[RW Split Router]
|
||||
type=service
|
||||
router=readwritesplit
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
filters=namedserverfilter
|
||||
|
||||
[CLI]
|
||||
type=service
|
||||
router=cli
|
||||
|
||||
[CLI Listener]
|
||||
type=listener
|
||||
service=CLI
|
||||
protocol=maxscaled
|
||||
socket=default
|
||||
|
||||
[Read Connection Router Slave]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=slave
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
|
||||
[Read Connection Router Master]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=master
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
|
||||
[RW Split Listener]
|
||||
type=listener
|
||||
service=RW Split Router
|
||||
protocol=MySQLClient
|
||||
port=4006
|
||||
|
||||
[Read Connection Listener Slave]
|
||||
type=listener
|
||||
service=Read Connection Router Slave
|
||||
protocol=MySQLClient
|
||||
port=4009
|
||||
|
||||
[Read Connection Listener Master]
|
||||
type=listener
|
||||
service=Read Connection Router Master
|
||||
protocol=MySQLClient
|
||||
port=4008
|
||||
|
||||
[server1]
|
||||
type=server
|
||||
address=###node_server_IP_1###
|
||||
port=###node_server_port_1###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server2]
|
||||
type=server
|
||||
address=###node_server_IP_2###
|
||||
port=###node_server_port_2###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server3]
|
||||
type=server
|
||||
address=###node_server_IP_3###
|
||||
port=###node_server_port_3###
|
||||
protocol=MySQLBackend
|
||||
|
||||
[server4]
|
||||
type=server
|
||||
address=###node_server_IP_4###
|
||||
port=###node_server_port_4###
|
||||
protocol=MySQLBackend
|
||||
@ -22,6 +22,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
char* version;
|
||||
|
||||
TestConnections::multiple_maxscales(true);
|
||||
TestConnections* Test = new TestConnections(argc, argv);
|
||||
Test->set_timeout(10);
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ int main(int argc, char* argv[])
|
||||
bool passive;
|
||||
char str[1024];
|
||||
|
||||
TestConnections::multiple_maxscales(true);
|
||||
TestConnections* Test = new TestConnections(argc, argv);
|
||||
// Test->set_timeout(10);
|
||||
|
||||
|
||||
23
maxscale-system-test/mxs2037_namedserver_wildcards.cpp
Normal file
23
maxscale-system-test/mxs2037_namedserver_wildcards.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* MXS-2037: Wildcards not working with source in NamedServerFilter
|
||||
*
|
||||
* https://jira.mariadb.org/browse/MXS-2037
|
||||
*
|
||||
* This test only tests that ip addresses with wildcards are accepted by
|
||||
* NamedServerFilter. The actual matching functionality is not tested
|
||||
* because the client IPs can change with the different test environments
|
||||
* and that would make it complicated to check if the matching is correct.
|
||||
*/
|
||||
|
||||
|
||||
#include "testconnections.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
test.set_timeout(10);
|
||||
test.maxscales->connect_maxscale(0);
|
||||
test.add_result(execute_query(test.maxscales->conn_rwsplit[0], "select 1"), "Can't connect to backend");
|
||||
test.maxscales->close_maxscale_connections(0);
|
||||
return test.global_result;
|
||||
}
|
||||
@ -21,13 +21,13 @@ int main(int argc, char** argv)
|
||||
test.repl->connect();
|
||||
delete_slave_binlogs(test);
|
||||
|
||||
test.maxscales->wait_for_monitor();
|
||||
test.maxscales->wait_for_monitor(2);
|
||||
basic_test(test);
|
||||
print_gtids(test);
|
||||
|
||||
// Part 1
|
||||
int node0_id = prepare_test_1(test);
|
||||
test.maxscales->wait_for_monitor();
|
||||
test.maxscales->wait_for_monitor(2);
|
||||
check_test_1(test, node0_id);
|
||||
|
||||
if (test.global_result != 0)
|
||||
@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
||||
|
||||
// Part 2
|
||||
prepare_test_2(test);
|
||||
test.maxscales->wait_for_monitor();
|
||||
test.maxscales->wait_for_monitor(2);
|
||||
check_test_2(test);
|
||||
|
||||
if (test.global_result != 0)
|
||||
@ -47,7 +47,7 @@ int main(int argc, char** argv)
|
||||
|
||||
// Part 3
|
||||
prepare_test_3(test);
|
||||
test.maxscales->wait_for_monitor();
|
||||
test.maxscales->wait_for_monitor(2);
|
||||
check_test_3(test);
|
||||
|
||||
return test.global_result;
|
||||
|
||||
@ -25,6 +25,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 multiple_maxscales = false;
|
||||
}
|
||||
|
||||
static void signal_set(int sig, void (* handler)(int))
|
||||
@ -57,6 +58,11 @@ void TestConnections::skip_maxscale_start(bool value)
|
||||
maxscale::start = !value;
|
||||
}
|
||||
|
||||
void TestConnections::multiple_maxscales(bool value)
|
||||
{
|
||||
maxscale::multiple_maxscales = value;
|
||||
}
|
||||
|
||||
void TestConnections::require_repl_version(const char* version)
|
||||
{
|
||||
maxscale::required_repl_version = version;
|
||||
@ -666,9 +672,15 @@ void TestConnections::process_template(int m, const char* template_name, const c
|
||||
|
||||
void TestConnections::init_maxscales()
|
||||
{
|
||||
for (int i = 0; i < maxscales->N; i++)
|
||||
// Always initialize the first MaxScale
|
||||
init_maxscale(0);
|
||||
|
||||
if (maxscale::multiple_maxscales)
|
||||
{
|
||||
init_maxscale(i);
|
||||
for (int i = 1; i < maxscales->N; i++)
|
||||
{
|
||||
init_maxscale(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -250,6 +250,9 @@ public:
|
||||
/** Skip initial start of MaxScale */
|
||||
static void skip_maxscale_start(bool value);
|
||||
|
||||
/** Prepare multiple maxscale instances */
|
||||
static void multiple_maxscales(bool value);
|
||||
|
||||
/** Test requires a certain backend version */
|
||||
static void require_repl_version(const char* version);
|
||||
static void require_galera_version(const char* version);
|
||||
|
||||
Reference in New Issue
Block a user