2005-09-30 23:14:50 +02:00
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# This file contains test for (1.2) test suite.
|
|
|
|
#
|
|
|
|
# Consult WL#2789 for more information.
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started.
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
2006-07-20 11:24:12 +02:00
|
|
|
--source include/im_check_env.inc
|
2005-09-30 23:14:50 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
# Turn on reconnect, not on by default anymore.
|
2006-10-06 14:15:03 +02:00
|
|
|
--enable_reconnect
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# 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;
|
|
|
|
#
|
2007-02-23 18:24:32 +01:00
|
|
|
# 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.
|
|
|
|
#
|
2006-06-19 12:13:34 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: starting...
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
|
2006-10-03 16:42:59 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: done.
|
2006-10-03 16:42:59 +02:00
|
|
|
|
|
|
|
###########################################################################
|
2006-09-01 16:20:33 +02:00
|
|
|
#
|
|
|
|
# BUG#12751: Instance Manager: client hangs
|
2006-11-23 20:55:36 +01:00
|
|
|
# - 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.
|
2006-09-01 16:20:33 +02:00
|
|
|
#
|
2006-11-23 20:55:36 +01:00
|
|
|
###########################################################################
|
2006-09-01 16:20:33 +02:00
|
|
|
|
|
|
|
--echo
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--echo -- Test for BUG#12751
|
|
|
|
--echo --------------------------------------------------------------------
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: starting...
|
2006-09-01 16:20:33 +02:00
|
|
|
|
|
|
|
# 1. Start mysqld;
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: starting...
|
2006-09-01 16:20:33 +02:00
|
|
|
START INSTANCE mysqld2;
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to start...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: started.
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
# 2. Restart IM-main;
|
2006-11-02 14:53:14 +01:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
|
2006-11-23 20:55:36 +01:00
|
|
|
|
|
|
|
# 3. Issue some statement -- connection should be re-established.
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Checking that IM-main processing commands...
|
2006-09-01 16:20:33 +02:00
|
|
|
|
2007-02-23 18:24:32 +01:00
|
|
|
--replace_column 2 STATE 3 VERSION
|
2006-09-01 16:20:33 +02:00
|
|
|
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.
|
|
|
|
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopping...
|
2006-09-01 16:20:33 +02:00
|
|
|
STOP INSTANCE mysqld2;
|
2006-11-23 20:55:36 +01:00
|
|
|
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to stop...
|
2007-02-23 18:24:32 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle
|
2006-11-23 20:55:36 +01:00
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopped.
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: done.
|