mirror of
https://github.com/MariaDB/server.git
synced 2025-11-15 09:02:33 +03:00
Add Instance Manager tests. mysql-test/include/im_check_os.inc: Currently Instance Manager tests are known to work only on UNIX platform. This header file is included in each IM-test in order to skip the test on Windows. mysql-test/r/im_daemon_life_cycle.result: Results file for Instance Manager daemon test. mysql-test/r/im_life_cycle.result: Results file for Instance Manager life cycle test. mysql-test/r/im_options_set.result: Results file for Instance Manager SET statement test. mysql-test/r/im_options_unset.result: Results file for Instance Manager UNSET statement test. mysql-test/r/im_utils.result: Results file for Instance Manager utils test. mysql-test/t/im_daemon_life_cycle-im.opt: Options file for Instance Manager daemon test. mysql-test/t/im_daemon_life_cycle.imtest: Instance Manager daemon test (mysqltestrun-part). mysql-test/t/im_life_cycle.imtest: Instance Manager life cycle test. mysql-test/t/im_options_set.imtest: Instance Manager SET statement test. mysql-test/t/im_options_unset.imtest: Instance Manager UNSET statement test. mysql-test/t/im_utils.imtest: Instance Manager utils test. mysql-test/t/kill_n_check.sh: The helper script. Its main idea is to kill some process and check that the process will (or will not) be restarted.
142 lines
3.9 KiB
Plaintext
142 lines
3.9 KiB
Plaintext
###########################################################################
|
|
#
|
|
# This file contains test for (1.1) test suite.
|
|
#
|
|
# Consult WL#2789 for more information.
|
|
#
|
|
###########################################################################
|
|
|
|
--source include/im_check_os.inc
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.1. Check that Instance Manager is able:
|
|
# - to read definitions of two mysqld-instances;
|
|
# - to start the first instance;
|
|
# - to understand 'nonguarded' option and keep the second instance down;
|
|
#
|
|
###########################################################################
|
|
|
|
SHOW INSTANCES;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld1;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld2;
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.2. Check 'START INSTANCE' command:
|
|
# - start the second instance;
|
|
# - check that it is reported as online;
|
|
# - execute some SQL-statement on mysqld2 to ensure that it is really up and
|
|
# running;
|
|
#
|
|
###########################################################################
|
|
|
|
START INSTANCE mysqld2;
|
|
# FIXME
|
|
--sleep 3
|
|
|
|
SHOW INSTANCES;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld1;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld2;
|
|
|
|
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
|
|
--connection mysql_con
|
|
|
|
SHOW VARIABLES LIKE 'port';
|
|
|
|
--connection default
|
|
--disconnect mysql_con
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.3. Check 'STOP INSTANCE' command:
|
|
# - stop the second instance;
|
|
# - check that it is reported as offline;
|
|
# - TODO: try to execute some SQL-statement to ensure that it is really down;
|
|
#
|
|
###########################################################################
|
|
|
|
STOP INSTANCE mysqld2;
|
|
# FIXME
|
|
--sleep 3
|
|
|
|
SHOW INSTANCES;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld1;
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld2;
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.4. Check that Instance Manager reports correct errors for 'START
|
|
# INSTANCE' command:
|
|
# - if the client tries to start unregistered instance;
|
|
# - if the client tries to start already started instance;
|
|
# - if the client submits invalid arguments;
|
|
#
|
|
###########################################################################
|
|
|
|
--error 3000
|
|
START INSTANCE mysqld3;
|
|
|
|
--error 3002
|
|
START INSTANCE mysqld1;
|
|
|
|
# FIXME TODO
|
|
# BUG#12813: START/STOP INSTANCE commands accept a list as argument
|
|
# START INSTANCE mysqld1, mysqld2;
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.5. Check that Instance Manager reports correct errors for 'STOP INSTANCE'
|
|
# command:
|
|
# - if the client tries to start unregistered instance;
|
|
# - if the client tries to start already stopped instance;
|
|
# - if the client submits invalid arguments;
|
|
#
|
|
###########################################################################
|
|
|
|
--error 3000
|
|
STOP INSTANCE mysqld3;
|
|
|
|
# TODO: IM should be fixed.
|
|
# BUG#12673: Instance Manager allows to stop the instance many times
|
|
# --error 3002
|
|
# STOP INSTANCE mysqld2;
|
|
|
|
# FIXME TODO
|
|
# BUG#12813: START/STOP INSTANCE commands accept a list as argument
|
|
# STOP INSTANCE mysqld1, mysqld2;
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.6. Check that Instance Manager is able to restart guarded instances.
|
|
#
|
|
###########################################################################
|
|
|
|
SHOW INSTANCES;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted
|
|
|
|
###########################################################################
|
|
#
|
|
# 1.1.7. Check that Instance Manager does not restart non-guarded instance.
|
|
#
|
|
###########################################################################
|
|
|
|
SHOW INSTANCES;
|
|
|
|
START INSTANCE mysqld2;
|
|
# FIXME
|
|
--sleep 3
|
|
|
|
SHOW INSTANCES;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed
|
|
|
|
SHOW INSTANCES;
|