File: gr_recovery_endpoints_invalid_conf.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (181 lines) | stat: -rw-r--r-- 8,171 bytes parent folder | download
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
49
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
###############################################################################
# Validation on recovery endpoints variable
#
# Test:
#   0. The test requires two servers
#   1. Persist only group_replication_advertise_recovery_endpoints, it
#      will be updated on configuration and read after restart
#   2. Restart server and start Group Replication on boot, it will fail
#      due invalid configuration
#   3. Assert server log message on wrong option on recovery endpoints
#   4. Persist only group_replication_advertise_recovery_endpoints, it
#      will be updated on configuration and read after restart
#   5. Restart server and start Group Replication on boot, it will fail
#      due configuration bad format
#   6. Assert server log message on wrong option on recovery endpoints
#   7. START GROUP_REPLICATION , it will fail due invalid format.
#   8. Restart server and start Group Replication with command START
#      GROUP_REPLICATION , it will fail due invalid endpoint
#   9. Try invalid configurations and confirm all return error
#  10. Clean up
#
###############################################################################

--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--let $server1_port= `SELECT @@GLOBAL.PORT`

--echo
--echo # 1. Persist only group_replication_advertise_recovery_endpoints, it
--echo #    will be updated on configuration and read after restart

SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:0";

--echo
--echo # 2. Restart server and start Group Replication on boot, it will fail
--echo #    due invalid configuration

--let $allow_rpl_inited= 1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--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
--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
--source include/restart_mysqld.inc

--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--echo
--echo # 3. Assert server log message on wrong option on recovery endpoints

--let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_count = 1
--let $assert_select = .*The server is not listening on endpoint '127.0.0.1:0'*
--let $assert_text = invalid configuration used on recovery endpoints
--source include/assert_grep.inc

--echo
--echo # 4. Persist only group_replication_advertise_recovery_endpoints, it
--echo #    will be updated on configuration and read after restart

SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "127.0.0.1:3600a";

--echo
--echo # 5. Restart server and start Group Replication on boot, it will fail
--echo #    due configuration bad format

--let $allow_rpl_inited= 1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--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
--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
--source include/restart_mysqld.inc

--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--echo
--echo # 6. Assert server log message on wrong option on recovery endpoints

--let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_conf
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_count = 1
--let $assert_select = .*Invalid input value for recovery socket endpoints '127.0.0.1:3600a'*
--let $assert_text = invalid configuration used on recovery endpoints
--source include/assert_grep.inc

--echo
--echo # 7. START GROUP_REPLICATION , it will fail due invalid format.

--error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT
START GROUP_REPLICATION;

--echo
--echo # 8. Restart server and start Group Replication with command START
--echo #    GROUP_REPLICATION , it will fail due invalid endpoint

SET PERSIST_ONLY group_replication_advertise_recovery_endpoints = "128.0.0.1:3600";

 --let $allow_rpl_inited= 1
 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
 --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
 --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
 --source include/restart_mysqld.inc

 --let $rpl_server_number= 1
 --source include/rpl_reconnect.inc

--error ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID
START GROUP_REPLICATION;

--echo
--echo # 9. Try invalid configurations and confirm all return error

# Invalid port

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1:0"

# Invalid IPv4

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.500:1234"

# Invalid IPv6

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1:1234"

# Valid IPv6 with port diferent from default or mysqld_admin

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[::1]:1234"

# Valid IPv6 but not from localhost

--replace_result $server1_port SERVER1_PORT
--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "[0:0:0:0:0:0:0:2]:$server1_port"

# Invalid use of namespace

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1/namespace:1234"

# Hostname not present on machine

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "unusedhostname:1234"

# Valid host with invalid port

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "localhost:123"

# Empty string not allowed

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= ""

# Bad format without port

--error ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART
--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "127.0.0.1"

--echo
--echo # 10. Clean up

--eval SET @@GLOBAL.group_replication_advertise_recovery_endpoints= "DEFAULT"
RESET PERSIST group_replication_advertise_recovery_endpoints;

set session sql_log_bin=0;
call mtr.add_suppression("Invalid input value for recovery socket endpoints '127.0.0.1:3600a'.*");
call mtr.add_suppression("The server is not listening on endpoint '127.0.0.1:0'.*");
call mtr.add_suppression("Unable to start Group Replication on boot");
set session sql_log_bin=1;

--source include/group_replication_end.inc