Debian Codegraph @

mysql-test/suite/group_replication/t/gr_recovery_endpoints_invalid_conf.test

raw
1 ###############################################################################
2 # Validation on recovery endpoints variable
3 #
4 # Test:
5 # 0. The test requires two servers
6 # 1. Persist only group_replication_advertise_recovery_endpoints, it
7 # will be updated on configuration and read after restart
8 # 2. Restart server and start Group Replication on boot, it will fail
9 # due invalid configuration
10 # 3. Assert server log message on wrong option on recovery endpoints
11 # 4. Persist only group_replication_advertise_recovery_endpoints, it
12 # will be updated on configuration and read after restart
13 # 5. Restart server and start Group Replication on boot, it will fail
14 # due configuration bad format
15 # 6. Assert server log message on wrong option on recovery endpoints
16 # 7. START GROUP_REPLICATION , it will fail due invalid format.
17 # 8. Restart server and start Group Replication with command START
18 # GROUP_REPLICATION , it will fail due invalid endpoint
19 # 9. Try invalid configurations and confirm all return error
20 # 10. Clean up
21 #
22 ###############################################################################
23
24 --source include/have_group_replication_plugin.inc
25 --let $rpl_skip_group_replication_start= 1
26 --source include/group_replication.inc
27
28 --let $server1_port= `SELECT @@GLOBAL.PORT`
29
30 --echo
31 --echo # 1. Persist only group_replication_advertise_recovery_endpoints, it
32 --echo # will be updated on configuration and read after restart
33
34 SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:0";
35
36 --echo
37 --echo # 2. Restart server and start Group Replication on boot, it will fail
38 --echo # due invalid configuration
39
40 --let $allow_rpl_inited= 1
41 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
42 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
43 --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1
44 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
45 --source include/restart_mysqld.inc
46
47 --let $rpl_server_number= 1
48 --source include/rpl_reconnect.inc
49
50 --echo
51 --echo # 3. Assert server log message on wrong option on recovery endpoints
52
53 --let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf
54 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
55 --let $assert_count = 1
56 --let $assert_select = .*The server is not listening on endpoint '127.0.0.1:0'*
57 --let $assert_text = invalid configuration used on recovery endpoints
58 --source include/assert_grep.inc
59
60 --echo
61 --echo # 4. Persist only group_replication_advertise_recovery_endpoints, it
62 --echo # will be updated on configuration and read after restart
63
64 SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:3600a";
65
66 --echo
67 --echo # 5. Restart server and start Group Replication on boot, it will fail
68 --echo # due configuration bad format
69
70 --let $allow_rpl_inited= 1
71 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
72 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
73 --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1
74 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
75 --source include/restart_mysqld.inc
76
77 --let $rpl_server_number= 1
78 --source include/rpl_reconnect.inc
79
80 --echo
81 --echo # 6. Assert server log message on wrong option on recovery endpoints
82
83 --let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf
84 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
85 --let $assert_count = 1
86 --let $assert_select = .*Invalid input value for recovery socket endpoints '127.0.0.1:3600a'*
87 --let $assert_text = invalid configuration used on recovery endpoints
88 --source include/assert_grep.inc
89
90 --echo
91 --echo # 7. START GROUP_REPLICATION , it will fail due invalid format.
92
93 --error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT
94 START GROUP_REPLICATION;
95
96 --echo
97 --echo # 8. Restart server and start Group Replication with command START
98 --echo # GROUP_REPLICATION , it will fail due invalid endpoint
99
100 SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "128.0.0.1:3600";
101
102 --let $allow_rpl_inited= 1
103 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
104 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
105 --let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=0
106 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
107 --source include/restart_mysqld.inc
108
109 --let $rpl_server_number= 1
110 --source include/rpl_reconnect.inc
111
112 --error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID
113 START GROUP_REPLICATION;
114
115 --echo
116 --echo # 9. Try invalid configurations and confirm all return error
117
118 # Invalid port
119
120 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
121 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1:0"
122
123 # Invalid IPv4
124
125 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
126 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.500:1234"
127
128 # Invalid IPv6
129
130 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
131 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1:1234"
132
133 # Valid IPv6 with port diferent from default or mysqld_admin
134
135 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
136 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1]:1234"
137
138 # Valid IPv6 but not from localhost
139
140 --replace_result $server1_port SERVER1_PORT
141 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
142 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[0:0:0:0:0:0:0:2]:$server1_port"
143
144 # Invalid use of namespace
145
146 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
147 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1/namespace:1234"
148
149 # Hostname not present on machine
150
151 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
152 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "unusedhostname:1234"
153
154 # Valid host with invalid port
155
156 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
157 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "localhost:123"
158
159 # Empty string not allowed
160
161 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
162 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= ""
163
164 # Bad format without port
165
166 --error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
167 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1"
168
169 --echo
170 --echo # 10. Clean up
171
172 --eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "DEFAULT"
173 RESET PERSIST group_replication_advertise_recovery_endpoints;
174
175 set session sql_log_bin=0;
176 call mtr.add_suppression("Invalid input value for recovery socket endpoints '127.0.0.1:3600a'.*");
177 call mtr.add_suppression("The server is not listening on endpoint '127.0.0.1:0'.*");
178 call mtr.add_suppression("Unable to start Group Replication on boot");
179 set session sql_log_bin=1;
180
181 --source include/group_replication_end.inc