mariadb/mysql-test/suite/im/t/im_life_cycle.imtest
unknown b201a6c7ac Move instance manager tests to it's own suite
mysql-test/suite/im/t/im_daemon_life_cycle-im.opt:
  Rename: mysql-test/t/im_daemon_life_cycle-im.opt -> mysql-test/suite/im/t/im_daemon_life_cycle-im.opt
mysql-test/suite/im/t/im_instance_conf-im.opt:
  Rename: mysql-test/t/im_instance_conf-im.opt -> mysql-test/suite/im/t/im_instance_conf-im.opt
mysql-test/suite/im/t/im_life_cycle-im.opt:
  Rename: mysql-test/t/im_life_cycle-im.opt -> mysql-test/suite/im/t/im_life_cycle-im.opt
mysql-test/suite/im/t/im_options-im.opt:
  Rename: mysql-test/t/im_options-im.opt -> mysql-test/suite/im/t/im_options-im.opt
mysql-test/suite/im/t/im_utils-im.opt:
  Rename: mysql-test/t/im_utils-im.opt -> mysql-test/suite/im/t/im_utils-im.opt
mysql-test/suite/im/r/im_cmd_line.result:
  Rename: mysql-test/r/im_cmd_line.result -> mysql-test/suite/im/r/im_cmd_line.result
mysql-test/suite/im/r/im_daemon_life_cycle.result:
  Rename: mysql-test/r/im_daemon_life_cycle.result -> mysql-test/suite/im/r/im_daemon_life_cycle.result
mysql-test/suite/im/r/im_instance_conf.result:
  Rename: mysql-test/r/im_instance_conf.result -> mysql-test/suite/im/r/im_instance_conf.result
mysql-test/suite/im/r/im_life_cycle.result:
  Rename: mysql-test/r/im_life_cycle.result -> mysql-test/suite/im/r/im_life_cycle.result
mysql-test/suite/im/r/im_options.result:
  Rename: mysql-test/r/im_options.result -> mysql-test/suite/im/r/im_options.result
mysql-test/suite/im/r/im_utils.result:
  Rename: mysql-test/r/im_utils.result -> mysql-test/suite/im/r/im_utils.result
mysql-test/suite/im/t/utils.sh:
  Rename: mysql-test/t/utils.sh -> mysql-test/suite/im/t/utils.sh
mysql-test/suite/im/t/wait_for_process.sh:
  Rename: mysql-test/t/wait_for_process.sh -> mysql-test/suite/im/t/wait_for_process.sh
mysql-test/suite/im/t/wait_for_socket.sh:
  Rename: mysql-test/t/wait_for_socket.sh -> mysql-test/suite/im/t/wait_for_socket.sh
mysql-test/suite/im/t/log.sh:
  Rename: mysql-test/t/log.sh -> mysql-test/suite/im/t/log.sh
mysql-test/suite/im/t/kill_n_check.sh:
  Rename: mysql-test/t/kill_n_check.sh -> mysql-test/suite/im/t/kill_n_check.sh
mysql-test/suite/im/t/im_check_env.inc:
  Rename: mysql-test/include/im_check_env.inc -> mysql-test/suite/im/t/im_check_env.inc
mysql-test/suite/im/t/im_cmd_line.imtest:
  Update location of im_check_env.inc
mysql-test/suite/im/t/im_daemon_life_cycle.imtest:
  Update location of im_check_env.inc
  Add variable UTIL that points to the "ugly" .sh scripts
mysql-test/suite/im/t/im_instance_conf.imtest:
  Update location of im_check_env.inc
mysql-test/suite/im/t/im_life_cycle.imtest:
  Update location of im_check_env.inc
  Add variable UTIL that points to the "ugly" .sh scripts
mysql-test/suite/im/t/im_options.imtest:
  Update location of im_check_env.inc
mysql-test/suite/im/t/im_utils.imtest:
  Update location of im_check_env.inc
  Add variable UTIL that points to the "ugly" .sh scripts
mysql-test/t/disabled.def:
  Move disabled im test to suite/im/t/disabled.def
mysql-test/suite/im/t/disabled.def:
  New BitKeeper file ``mysql-test/suite/im/t/disabled.def''
2007-08-29 19:02:33 +02:00

205 lines
6.7 KiB
Text

let $UTIL=$MYSQL_TEST_DIR/suite/im/t;
###########################################################################
#
# This file contains test for (1.1) test suite.
#
# Consult WL#2789 for more information.
#
###########################################################################
--source suite/im/t/im_check_env.inc
###########################################################################
#
# 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;
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.2.
--echo --------------------------------------------------------------------
START INSTANCE mysqld2;
# FIXME: START INSTANCE should be synchronous.
--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
# 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.
# SHOW INSTANCES;
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD2_PORT,$IM_MYSQLD2_SOCK)
--connection mysql_con
--replace_result $IM_MYSQLD2_PORT IM_MYSQLD2_PORT
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;
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.3.
--echo --------------------------------------------------------------------
STOP INSTANCE mysqld2;
# FIXME: STOP INSTANCE should be synchronous.
--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_life_cycle
# 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.
# SHOW INSTANCES;
###########################################################################
#
# 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;
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.4.
--echo --------------------------------------------------------------------
--error 3000 # ER_BAD_INSTANCE_NAME
START INSTANCE mysqld3;
--error 3002 # ER_INSTANCE_ALREADY_STARTED
START INSTANCE mysqld1;
###########################################################################
#
# 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;
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.5.
--echo --------------------------------------------------------------------
--error 3000 # ER_BAD_INSTANCE_NAME
STOP INSTANCE mysqld3;
# TODO: IM should be fixed.
# BUG#12673: Instance Manager allows to stop the instance many times
# --error 3002 # ER_INSTANCE_ALREADY_STARTED
# STOP INSTANCE mysqld2;
###########################################################################
#
# 1.1.6. Check that Instance Manager is able to restart guarded instances.
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.6.
--echo --------------------------------------------------------------------
--exec $UTIL/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30 im_life_cycle
# Give some time to IM to detect that mysqld was restarted. It should be
# longer than monitoring interval.
--sleep 3
SHOW INSTANCES;
###########################################################################
#
# 1.1.7. Check that Instance Manager does not restart non-guarded instance.
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.7.
--echo --------------------------------------------------------------------
START INSTANCE mysqld2;
# FIXME: START INSTANCE should be synchronous.
--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle
# 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.
# SHOW INSTANCES;
--exec $UTIL/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10 im_life_cycle
# 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.
# SHOW INSTANCES;
###########################################################################
#
# 1.1.8. Check that Instance Manager returns an error on
# incomplete SHOW INSTANCE STATUS command.
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- 1.1.8.
--echo --------------------------------------------------------------------
--error ER_SYNTAX_ERROR
SHOW INSTANCE STATUS;
#
# Tests for bug fixes
#
#
# Bug #12813 Instance Manager: START/STOP INSTANCE commands accept
# a list as argument.
#
--echo
--echo --------------------------------------------------------------------
--echo -- BUG#12813
--echo --------------------------------------------------------------------
--error ER_SYNTAX_ERROR
START INSTANCE mysqld1,mysqld2,mysqld3;
--error ER_SYNTAX_ERROR
STOP INSTANCE mysqld1,mysqld2,mysqld3;
#
# Bug #12673: Instance Manager: allows to stop the instance many times
#
--error 3001
STOP INSTANCE mysqld2;
--echo End of 5.0 tests