2005-09-30 23:14:50 +02:00
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# This file contains test for (1.1) test suite.
|
|
|
|
#
|
|
|
|
# Consult WL#2789 for more information.
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
--source include/im_check_env.inc
|
2005-09-30 23:14:50 +02:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 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;
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.2.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
2005-09-30 23:14:50 +02:00
|
|
|
START INSTANCE mysqld2;
|
2006-06-19 12:13:34 +02:00
|
|
|
# FIXME: START INSTANCE should be synchronous.
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
|
|
|
|
# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
|
|
|
|
# its pid file is not enough, because it is unknown when IM detects that
|
|
|
|
# mysqld has started.
|
2006-06-19 12:13:34 +02:00
|
|
|
# SHOW INSTANCES;
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD2_PORT,$IM_MYSQLD2_SOCK)
|
2005-09-30 23:14:50 +02:00
|
|
|
--connection mysql_con
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--replace_result $IM_MYSQLD2_PORT IM_MYSQLD2_PORT
|
2005-09-30 23:14:50 +02:00
|
|
|
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;
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.3.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
2005-09-30 23:14:50 +02:00
|
|
|
STOP INSTANCE mysqld2;
|
2006-06-19 12:13:34 +02:00
|
|
|
# FIXME: STOP INSTANCE should be synchronous.
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_life_cycle
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
|
|
|
|
# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
|
|
|
|
# its pid file is not enough, because it is unknown when IM detects that
|
|
|
|
# mysqld has started.
|
2006-06-19 12:13:34 +02:00
|
|
|
# SHOW INSTANCES;
|
2005-09-30 23:14:50 +02:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 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;
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.4.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
|
|
|
--error 3000 # ER_BAD_INSTANCE_NAME
|
2005-09-30 23:14:50 +02:00
|
|
|
START INSTANCE mysqld3;
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--error 3002 # ER_INSTANCE_ALREADY_STARTED
|
2005-09-30 23:14:50 +02:00
|
|
|
START INSTANCE mysqld1;
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
2006-07-20 11:24:12 +02:00
|
|
|
# 1.1.5. Check that Instance Manager reports correct errors for
|
|
|
|
# 'STOP INSTANCE' command:
|
2005-09-30 23:14:50 +02:00
|
|
|
# - if the client tries to start unregistered instance;
|
|
|
|
# - if the client tries to start already stopped instance;
|
|
|
|
# - if the client submits invalid arguments;
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.5.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
|
|
|
--error 3000 # ER_BAD_INSTANCE_NAME
|
2005-09-30 23:14:50 +02:00
|
|
|
STOP INSTANCE mysqld3;
|
|
|
|
|
|
|
|
# TODO: IM should be fixed.
|
|
|
|
# BUG#12673: Instance Manager allows to stop the instance many times
|
2006-06-19 12:13:34 +02:00
|
|
|
# --error 3002 # ER_INSTANCE_ALREADY_STARTED
|
2005-09-30 23:14:50 +02:00
|
|
|
# STOP INSTANCE mysqld2;
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 1.1.6. Check that Instance Manager is able to restart guarded instances.
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.6.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30 im_life_cycle
|
2006-06-19 12:13:34 +02:00
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
# Give some time to IM to detect that mysqld was restarted. It should be
|
|
|
|
# longer than monitoring interval.
|
2006-06-19 12:13:34 +02:00
|
|
|
|
|
|
|
--sleep 3
|
|
|
|
|
|
|
|
SHOW INSTANCES;
|
2005-09-30 23:14:50 +02:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 1.1.7. Check that Instance Manager does not restart non-guarded instance.
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.7.
|
|
|
|
--echo --------------------------------------------------------------------
|
2005-09-30 23:14:50 +02:00
|
|
|
|
|
|
|
START INSTANCE mysqld2;
|
2006-06-19 12:13:34 +02:00
|
|
|
# FIXME: START INSTANCE should be synchronous.
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
|
|
|
|
# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
|
|
|
|
# its pid file is not enough, because it is unknown when IM detects that
|
|
|
|
# mysqld has started.
|
2006-06-19 12:13:34 +02:00
|
|
|
# SHOW INSTANCES;
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10 im_life_cycle
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
# FIXME: Result of SHOW INSTANCES here is not deterministic unless START
|
|
|
|
# INSTANCE is synchronous. Even waiting for mysqld to start by looking at
|
|
|
|
# its pid file is not enough, because it is unknown when IM detects that
|
|
|
|
# mysqld has started.
|
2006-06-19 12:13:34 +02:00
|
|
|
# SHOW INSTANCES;
|
2006-02-10 00:15:55 +01:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 1.1.8. Check that Instance Manager returns an error on
|
|
|
|
# incomplete SHOW INSTANCE STATUS command.
|
|
|
|
#
|
|
|
|
###########################################################################
|
2006-06-19 12:13:34 +02:00
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- 1.1.8.
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
|
|
|
--error ER_SYNTAX_ERROR
|
2006-02-10 00:15:55 +01:00
|
|
|
SHOW INSTANCE STATUS;
|
2006-02-14 01:09:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Tests for bug fixes
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Bug #12813 Instance Manager: START/STOP INSTANCE commands accept
|
|
|
|
# a list as argument.
|
|
|
|
#
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- BUG#12813
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
|
|
|
--error ER_SYNTAX_ERROR
|
2006-02-14 01:09:17 +01:00
|
|
|
START INSTANCE mysqld1,mysqld2,mysqld3;
|
|
|
|
|
2006-06-19 12:13:34 +02:00
|
|
|
--error ER_SYNTAX_ERROR
|
2006-02-14 01:09:17 +01:00
|
|
|
STOP INSTANCE mysqld1,mysqld2,mysqld3;
|
2006-07-12 21:30:22 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Bug #12673: Instance Manager: allows to stop the instance many times
|
|
|
|
#
|
|
|
|
--error 3001
|
|
|
|
STOP INSTANCE mysqld2;
|
|
|
|
|
|
|
|
--echo End of 5.0 tests
|