Add basic MaxCtrl test
The test does a very minimal check for MaxCtrl functionality.
This commit is contained in:
@ -254,6 +254,9 @@ add_test_executable(different_size_rwsplit.cpp different_size_rwsplit replicatio
|
|||||||
# Tries to use 'maxkeys', 'maxpasswrd'
|
# Tries to use 'maxkeys', 'maxpasswrd'
|
||||||
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
|
||||||
|
add_test_executable(maxctrl_basic.cpp maxctrl_basic replication LABELS maxctrl REPL_BACKEND)
|
||||||
|
|
||||||
# MySQL Monitor Failover Test
|
# MySQL Monitor Failover Test
|
||||||
add_test_executable(mysqlmon_detect_standalone_master.cpp mysqlmon_detect_standalone_master mysqlmon_detect_standalone_master LABELS mysqlmon REPL_BACKEND)
|
add_test_executable(mysqlmon_detect_standalone_master.cpp mysqlmon_detect_standalone_master mysqlmon_detect_standalone_master LABELS mysqlmon REPL_BACKEND)
|
||||||
|
|
||||||
|
31
maxscale-system-test/maxctrl_basic.cpp
Normal file
31
maxscale-system-test/maxctrl_basic.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Minimal MaxCtrl sanity check
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "testconnections.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
|
int rc = test.maxscales->ssh_node_f(0, false, "maxctrl help list servers");
|
||||||
|
test.assert(rc == 0, "`help list servers` should work");
|
||||||
|
|
||||||
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Master, Running'");
|
||||||
|
test.assert(rc == 0, "`list servers` should return at least one row with: Master, Running");
|
||||||
|
|
||||||
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl set server server1 maintenance");
|
||||||
|
test.assert(rc == 0, "`set server` should work");
|
||||||
|
|
||||||
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
||||||
|
test.assert(rc == 0, "`list servers` should return at least one row with: Maintanance");
|
||||||
|
|
||||||
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl clear server server1 maintenance");
|
||||||
|
test.assert(rc == 0, "`clear server` should work");
|
||||||
|
|
||||||
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
||||||
|
test.assert(rc != 0, "`list servers` should have no rows with: Maintanance");
|
||||||
|
|
||||||
|
test.check_maxscale_alive();
|
||||||
|
return test.global_result;
|
||||||
|
}
|
Reference in New Issue
Block a user