Add schemarouter reconfiguration test

Extended the alter_router test to check that modifications to schemarouter
are processed correctly.
This commit is contained in:
Markus Mäkelä 2018-07-09 14:20:18 +03:00
parent 5903e194a7
commit 151c7e19f4
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 105 additions and 1 deletions

View File

@ -525,7 +525,7 @@ add_test_executable(mxs922_scaling.cpp mxs922_scaling mxs922_base LABELS maxscal
add_test_executable(mxs922_listener_ssl.cpp mxs922_listener_ssl mxs922_base LABELS maxscale REPL_BACKEND)
# Alter routers at runtime
add_test_executable(alter_router.cpp alter_router replication LABELS maxscale REPL_BACKEND)
add_test_executable(alter_router.cpp alter_router alter_router LABELS maxscale REPL_BACKEND)
# Test of MaxRows filter
add_test_executable(mxs1071_maxrows.cpp mxs1071_maxrows maxrows LABELS maxrowsfilter REPL_BACKEND)

View File

@ -88,6 +88,21 @@ void alter_readconnroute(TestConnections& test)
}
}
void alter_schemarouter(TestConnections& test)
{
Connection conn = test.maxscales->readconn_slave();
conn.connect();
test.assert(!conn.query("SELECT 1"), "Query before reconfiguration should fail");
conn.disconnect();
int rc = test.maxscales->ssh_node_f(0, true, "maxctrl alter service SchemaRouter ignore_databases_regex '.*'");
test.assert(rc == 0, "Schemarouter alteration should work");
conn.connect();
test.assert(conn.query("SELECT 1"), "Query after reconfiguration should work: %s", conn.error());
conn.disconnect();
}
void alter_unsupported(TestConnections& test)
{
int rc = test.maxscales->ssh_node_f(0, true, "maxctrl alter service RW-Split-Router unknown parameter");
@ -104,6 +119,7 @@ int main(int argc, char** argv)
{
TEST(alter_readwritesplit),
TEST(alter_readconnroute),
TEST(alter_schemarouter),
TEST(alter_unsupported)
};

View File

@ -0,0 +1,88 @@
[maxscale]
threads=###threads###
[MySQL-Monitor]
type=monitor
module=mysqlmon
servers=server1,server2,server3,server4
user=maxskysql
passwd=skysql
monitor_interval=1000
detect_stale_master=false
detect_standalone_master=false
[RW-Split-Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=maxskysql
passwd=skysql
router_options=slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
max_slave_connections=1
[Read-Connection-Router-Master]
type=service
router=readconnroute
router_options=master
servers=server1,server2,server3,server4
user=maxskysql
passwd=skysql
[SchemaRouter]
type=service
router=schemarouter
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-Master]
type=listener
service=Read-Connection-Router-Master
protocol=MySQLClient
port=4008
[SchemaRouter-Listener]
type=listener
service=SchemaRouter
protocol=MySQLClient
port=4009
[CLI]
type=service
router=cli
[CLI-Listener]
type=listener
service=CLI
protocol=maxscaled
socket=default
[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