mariadb/mysql-test/suite/im/t/im_daemon_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

100 lines
3.8 KiB
Text

let $UTIL=$MYSQL_TEST_DIR/suite/im/t;
###########################################################################
#
# This file contains test for (1.2) test suite.
#
# Consult WL#2789 for more information.
#
###########################################################################
--exec $UTIL/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started.
###########################################################################
--source suite/im/t/im_check_env.inc
# Turn on reconnect, not on by default anymore.
--enable_reconnect
###########################################################################
#
# The main daemon-life-cycle test case -- check that IM-angel will restart
# IM-main if it got killed:
# - kill IM-main and check that IM-angel will restart it;
# - wait for IM-main to start accepting connections before continue test
# case;
#
# NOTE: timeout is 55 seconds. Timeout should be more than shutdown-delay
# specified for managed MySQL instance. Now shutdown-delay is 10 seconds
# (set in mysql-test-run.pl). So, 55 seconds should be enough to make 5
# attempts.
#
###########################################################################
--exec $UTIL/log.sh im_daemon_life_cycle Main-test: starting...
--exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main...
--exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
--exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
--exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
--exec $UTIL/log.sh im_daemon_life_cycle Main-test: done.
###########################################################################
#
# BUG#12751: Instance Manager: client hangs
# - start nonguarded instance (mysqld2);
# - kill IM-main and get it restarted by IM-angel;
# - check that guarded instance (mysqld1) is accepting connections.
# - check that non-guarded instance (mysqld2) were not stopped.
#
###########################################################################
--echo
--echo --------------------------------------------------------------------
--echo -- Test for BUG#12751
--echo --------------------------------------------------------------------
--exec $UTIL/log.sh im_daemon_life_cycle BUG12751: starting...
# 1. Start mysqld;
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: starting...
START INSTANCE mysqld2;
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to start...
--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: started.
# 2. Restart IM-main;
--exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main...
--exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
--exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
--exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
# 3. Issue some statement -- connection should be re-established.
--exec $UTIL/log.sh im_daemon_life_cycle Checking that IM-main processing commands...
--replace_column 2 STATE 3 VERSION_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
# 4. Stop mysqld2, because it will not be stopped by IM, as it is nonguarded.
# So, if it we do not stop it, it will be stopped by mysql-test-run.pl with
# warning.
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopping...
STOP INSTANCE mysqld2;
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to stop...
--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle
--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopped.
###########################################################################
--exec $UTIL/log.sh im_daemon_life_cycle BUG12751: done.