File: gr_ip_allowlist_precedence.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 (90 lines) | stat: -rw-r--r-- 4,182 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
################################################################################
# This test verify changed values are accepted between
# group_replication_ip_whitelist and group_replication_ip_allowlist.
# group_replication_ip_allowlist has high precendence over
# group_replication_ip_whitelist.
#
# Test:
# 0. The test requires two servers.
# 1. Bootstrap M1.
# 2. Set group_replication_ip_whitelist as AUTOMATIC and
#    group_replication_ip_allowlist as AUTOMATIC.
#    M2 join the group.
# 3. Set group_replication_ip_whitelist as incorrect_ip and
#    group_replication_ip_allowlist as AUTOMATIC.
#    M2 does not join the group, changed value of whitelist is used.
# 4. Set group_replication_ip_whitelist as AUTOMATIC and
#    group_replication_ip_allowlist as incorrect_ip.
#    M2 does not join the group, changed value of allowlist is used.
# 5. Set group_replication_ip_whitelist as incorrect_ip and
#    group_replication_ip_allowlist as correct_ip.
#    M2 joins the group, allowlist take precedence over whitelist.
# 6. Cleanup.
################################################################################
--let $group_replication_group_name= 8a94f357-aabb-ccdc-8899-cccaaff29573
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--let $_incorrect_gr_ip_whitelist="192.256.1.20"
--let $_correct_gr_ip_whitelist="127.0.0.1/8"

--echo # 1. Bootstrap M1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc

--echo # 2. Set group_replication_ip_whitelist as AUTOMATIC and
--echo #    group_replication_ip_allowlist as AUTOMATIC.
--echo #    M2 join the group.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--eval SET GLOBAL group_replication_group_name="$group_replication_group_name"
SET @saved_gr_ip_whitelist = @@GLOBAL.group_replication_ip_whitelist;
SET @saved_gr_ip_allowlist = @@GLOBAL.group_replication_ip_allowlist;

SET GLOBAL group_replication_ip_whitelist="AUTOMATIC";
SET GLOBAL group_replication_ip_allowlist="AUTOMATIC";
--source include/start_group_replication.inc
--source include/stop_group_replication.inc

--echo # 3. Set group_replication_ip_whitelist as incorrect_ip and
--echo #    group_replication_ip_allowlist as AUTOMATIC.
--echo #    M2 does not join the group, changed value of whitelist is used.

--eval SET GLOBAL group_replication_ip_whitelist=$_incorrect_gr_ip_whitelist
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;

--echo # 4. Set group_replication_ip_whitelist as AUTOMATIC and
--echo #    group_replication_ip_allowlist as incorrect_ip.
--echo #    M2 does not join the group, changed value of allowlist is used.

SET GLOBAL group_replication_ip_whitelist="AUTOMATIC";
--eval SET GLOBAL group_replication_ip_allowlist=$_incorrect_gr_ip_whitelist
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;

--echo # 5. Set group_replication_ip_whitelist as incorrect_ip and
--echo #    group_replication_ip_allowlist as correct_ip.
--echo #    M2 joins the group, allowlist take precedence over whitelist.

--eval SET GLOBAL group_replication_ip_whitelist=$_incorrect_gr_ip_whitelist
--eval SET GLOBAL group_replication_ip_allowlist=$_correct_gr_ip_whitelist
--source include/start_group_replication.inc
--source include/stop_group_replication.inc

--echo # 6. Cleanup.

SET @@GLOBAL.group_replication_ip_whitelist = @saved_gr_ip_whitelist;
SET @@GLOBAL.group_replication_ip_allowlist = @saved_gr_ip_allowlist;

SET SESSION sql_log_bin = 0;
call mtr.add_suppression("Unable to initialize the group communication engine");
call mtr.add_suppression("Error on group communication engine initialization");
call mtr.add_suppression("\\[GCS\\] Invalid IP or subnet mask in the allowlist:*");
call mtr.add_suppression("\\[GCS\\] Automatically adding IPv. localhost address to the allowlist. It is mandatory that it is added.");
call mtr.add_suppression("\\[GCS\\] Connection attempt from IP address*");
SET SESSION sql_log_bin = 1;

--source include/group_replication_end.inc