Extend maxctrl system test
The test now executes all commands present in MaxCtrl.
This commit is contained in:
@ -198,7 +198,7 @@ add_test_executable(different_size_rwsplit.cpp different_size_rwsplit replicatio
|
|||||||
add_test_executable(encrypted_passwords.cpp encrypted_passwords replication LABELS maxscale LIGHT REPL_BACKEND)
|
add_test_executable(encrypted_passwords.cpp encrypted_passwords replication LABELS maxscale LIGHT REPL_BACKEND)
|
||||||
|
|
||||||
# Basic MaxCtrl test
|
# Basic MaxCtrl test
|
||||||
add_test_executable(maxctrl_basic.cpp maxctrl_basic replication LABELS maxctrl REPL_BACKEND)
|
add_test_executable(maxctrl_basic.cpp maxctrl_basic maxctrl_basic LABELS maxctrl REPL_BACKEND)
|
||||||
|
|
||||||
# MXS-2167: Monitors should be able to use extra_port
|
# MXS-2167: Monitors should be able to use extra_port
|
||||||
add_test_executable(mxs2167_extra_port.cpp mxs2167_extra_port mxs2167_extra_port LABELS REPL_BACKEND)
|
add_test_executable(mxs2167_extra_port.cpp mxs2167_extra_port mxs2167_extra_port LABELS REPL_BACKEND)
|
||||||
|
95
maxscale-system-test/cnf/maxscale.cnf.template.maxctrl_basic
Normal file
95
maxscale-system-test/cnf/maxscale.cnf.template.maxctrl_basic
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
[maxscale]
|
||||||
|
threads=###threads###
|
||||||
|
|
||||||
|
[MySQL Monitor]
|
||||||
|
type=monitor
|
||||||
|
module=mysqlmon
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=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
|
||||||
|
password=skysql
|
||||||
|
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
|
||||||
|
max_slave_connections=1
|
||||||
|
|
||||||
|
[Read Connection Router Slave]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=slave
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
|
||||||
|
[Read Connection Router Master]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=master
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
filters=qla
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
||||||
|
[qla]
|
||||||
|
type=filter
|
||||||
|
module=qlafilter
|
||||||
|
filebase=/tmp/QueryLog
|
||||||
|
|
||||||
|
[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
|
@ -26,6 +26,76 @@ int main(int argc, char** argv)
|
|||||||
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
||||||
test.expect(rc != 0, "`list servers` should have no rows with: Maintanance");
|
test.expect(rc != 0, "`list servers` should have no rows with: Maintanance");
|
||||||
|
|
||||||
|
test.tprintf("Execute all available commands");
|
||||||
|
test.maxscales->ssh_node_f(0, false,
|
||||||
|
"maxctrl list servers;"
|
||||||
|
"maxctrl list services;"
|
||||||
|
"maxctrl list listeners RW-Split-Router;"
|
||||||
|
"maxctrl list monitors;"
|
||||||
|
"maxctrl list sessions;"
|
||||||
|
"maxctrl list filters;"
|
||||||
|
"maxctrl list modules;"
|
||||||
|
"maxctrl list threads;"
|
||||||
|
"maxctrl list users;"
|
||||||
|
"maxctrl list commands;"
|
||||||
|
"maxctrl show server server1;"
|
||||||
|
"maxctrl show servers;"
|
||||||
|
"maxctrl show service RW-Split-Router;"
|
||||||
|
"maxctrl show services;"
|
||||||
|
"maxctrl show monitor MySQL-Monitor;"
|
||||||
|
"maxctrl show monitors;"
|
||||||
|
"maxctrl show session 1;"
|
||||||
|
"maxctrl show sessions;"
|
||||||
|
"maxctrl show filter qla;"
|
||||||
|
"maxctrl show filters;"
|
||||||
|
"maxctrl show module readwritesplit;"
|
||||||
|
"maxctrl show modules;"
|
||||||
|
"maxctrl show maxscale;"
|
||||||
|
"maxctrl show thread 1;"
|
||||||
|
"maxctrl show threads;"
|
||||||
|
"maxctrl show logging;"
|
||||||
|
"maxctrl show commands mariadbmon;"
|
||||||
|
"maxctrl drain server server1;"
|
||||||
|
"maxctrl clear server server1 maintenance;"
|
||||||
|
"maxctrl enable log-priority info;"
|
||||||
|
"maxctrl enable account vagrant;"
|
||||||
|
"maxctrl disable log-priority info;"
|
||||||
|
"maxctrl disable account vagrant;"
|
||||||
|
"maxctrl create server server5 127.0.0.1 3306;"
|
||||||
|
"maxctrl create monitor mon1 mariadbmon user=skysql password=skysql;"
|
||||||
|
"maxctrl create service svc1 readwritesplit user=skysql password=skysql;"
|
||||||
|
"maxctrl create filter qla2 qlafilter filebase=/tmp/qla2.log;"
|
||||||
|
"maxctrl create listener svc1 listener1 9999;"
|
||||||
|
"maxctrl create user maxuser maxpwd;"
|
||||||
|
"maxctrl link service svc1 server5;"
|
||||||
|
"maxctrl link monitor mon1 server5;"
|
||||||
|
"maxctrl alter service-filters svc1 qla2"
|
||||||
|
"maxctrl unlink service svc1 server5;"
|
||||||
|
"maxctrl unlink monitor mon1 server5;"
|
||||||
|
"maxctrl alter service-filters svc1"
|
||||||
|
"maxctrl destroy server server5;"
|
||||||
|
"maxctrl destroy listener svc1 listener1;"
|
||||||
|
"maxctrl destroy monitor mon1;"
|
||||||
|
"maxctrl destroy filter qla2;"
|
||||||
|
"maxctrl destroy service svc1;"
|
||||||
|
"maxctrl destroy user maxuser;"
|
||||||
|
"maxctrl stop service RW-Split-Router;"
|
||||||
|
"maxctrl stop monitor MySQL-Monitor;"
|
||||||
|
"maxctrl stop maxscale;"
|
||||||
|
"maxctrl start service RW-Split-Router;"
|
||||||
|
"maxctrl start monitor MySQL-Monitor;"
|
||||||
|
"maxctrl start maxscale;"
|
||||||
|
"maxctrl alter server server1 port 3307;"
|
||||||
|
"maxctrl alter server server1 port 3306;"
|
||||||
|
"maxctrl alter monitor MySQL-Monitor auto_failover true;"
|
||||||
|
"maxctrl alter service RW-Split-Router max_slave_connections=3;"
|
||||||
|
"maxctrl alter logging highprecision true;"
|
||||||
|
"maxctrl alter maxscale passive true;"
|
||||||
|
"maxctrl rotate logs;"
|
||||||
|
"maxctrl call command mariadbmon reset-replication MySQL-Monitor;"
|
||||||
|
"maxctrl api get servers;"
|
||||||
|
"maxctrl classify 'select 1';");
|
||||||
|
|
||||||
test.check_maxscale_alive();
|
test.check_maxscale_alive();
|
||||||
return test.global_result;
|
return test.global_result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user