im_life_cycle.imtest 4.28 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
###########################################################################
#
# 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

49
--replace_result $IM_MYSQLD1_PORT IM_MYSQLD1_PORT
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
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;
143 144 145 146 147 148 149 150 151

###########################################################################
#
# 1.1.8. Check that Instance Manager returns an error on
# incomplete SHOW INSTANCE STATUS command.
#
###########################################################################
--error 1149
SHOW INSTANCE STATUS;