Debian Codegraph @

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

raw
1 #
2 # Validate that Group Replication ssl mode works properly with
3 # group_replication_tls_source=MYSQL_ADMIN
4 #
5 # Steps:
6 # 1. Start one member with GCS SSL enabled.
7 # 2. Start a second member with GCS SSL disabled, the member
8 # will fail to join the group.
9 # 3. Start the second member with GCS SSL enabled, the member
10 # will be able to join the group.
11 # 4. Start the second member with GCS SSL enabled and
12 # validating server certificate against the CA, the
13 # member will be able to join the group.
14 # 5. Start the second member with GCS SSL enabled and
15 # validating server certificate against the CA plus
16 # validating that server hostname matches server
17 # certificate hostname, the member will be able to join
18 # the group.
19 # 6. Clean up.
20 #
21 --source include/big_test.inc
22 --source include/have_group_replication_xcom_communication_stack.inc
23 --source include/have_group_replication_plugin.inc
24 --let $rpl_skip_group_replication_start= 1
25 --source include/group_replication.inc
26
27
28 --echo
29 --echo ############################################################
30 --echo # 1. Start one member with GCS SSL enabled.
31 --let $rpl_connection_name= server1
32 --source include/rpl_connection.inc
33 SET @group_replication_ssl_mode_save= @@GLOBAL.group_replication_ssl_mode;
34 SET GLOBAL group_replication_ssl_mode= REQUIRED;
35 --source include/start_and_bootstrap_group_replication.inc
36
37 --let $grep_file= $MYSQLTEST_VARDIR/tmp/gr_ssl_mode_tls_source_mysql_admin.1.err
38 --let $grep_pattern= Group communication SSL configuration: group_replication_ssl_mode: "REQUIRED"
39 --let $grep_output= print_count
40 --source include/grep_pattern.inc
41
42
43 --echo
44 --echo ############################################################
45 --echo # 2. Start a second member with GCS SSL disabled, the member
46 --echo # will fail to join the group.
47 --let $rpl_connection_name= server2
48 --source include/rpl_connection.inc
49 --disable_query_log
50 --eval SET GLOBAL group_replication_group_name= '$group_replication_group_name'
51 --enable_query_log
52
53 SET @group_replication_ssl_mode_save= @@GLOBAL.group_replication_ssl_mode;
54 SET GLOBAL group_replication_ssl_mode= DISABLED;
55 --error ER_GROUP_REPLICATION_CONFIGURATION
56 START GROUP_REPLICATION;
57
58 --let $grep_file= $MYSQLTEST_VARDIR/tmp/gr_ssl_mode_tls_source_mysql_admin.2.err
59 --let $grep_pattern= Group communication SSL configuration: group_replication_ssl_mode: "DISABLED"
60 --let $grep_output= print_count
61 --source include/grep_pattern.inc
62
63
64 --echo
65 --echo ############################################################
66 --echo # 3. Start the second member with GCS SSL enabled, the member
67 --echo # will be able to join the group.
68 SET GLOBAL group_replication_ssl_mode= REQUIRED;
69 --source include/start_group_replication.inc
70
71 --let $group_replication_number_of_members= 2
72 --source include/gr_wait_for_number_of_members.inc
73
74 --let $grep_file= $MYSQLTEST_VARDIR/tmp/gr_ssl_mode_tls_source_mysql_admin.2.err
75 --let $grep_pattern= Group communication SSL configuration: group_replication_ssl_mode: "REQUIRED"
76 --let $grep_output= print_count
77 --source include/grep_pattern.inc
78
79 --source include/stop_group_replication.inc
80
81
82 --echo
83 --echo ############################################################
84 --echo # 4. Start the second member with GCS SSL enabled and
85 --echo # validating server certificate against the CA, the
86 --echo # member will be able to join the group.
87 SET GLOBAL group_replication_ssl_mode= VERIFY_CA;
88 --source include/start_group_replication.inc
89
90 --let $group_replication_number_of_members= 2
91 --source include/gr_wait_for_number_of_members.inc
92
93 --let $grep_file= $MYSQLTEST_VARDIR/tmp/gr_ssl_mode_tls_source_mysql_admin.2.err
94 --let $grep_pattern= Group communication SSL configuration: group_replication_ssl_mode: "VERIFY_CA"
95 --let $grep_output= print_count
96 --source include/grep_pattern.inc
97
98 --source include/stop_group_replication.inc
99
100
101 --echo
102 --echo ############################################################
103 --echo # 5. Start the second member with GCS SSL enabled and
104 --echo # validating server certificate against the CA plus
105 --echo # validating that server hostname matches server
106 --echo # certificate hostname, the member will be able to join
107 --echo # the group.
108 SET GLOBAL group_replication_ssl_mode= VERIFY_IDENTITY;
109 --source include/start_group_replication.inc
110
111 --let $group_replication_number_of_members= 2
112 --source include/gr_wait_for_number_of_members.inc
113
114 --let $grep_file= $MYSQLTEST_VARDIR/tmp/gr_ssl_mode_tls_source_mysql_admin.2.err
115 --let $grep_pattern= Group communication SSL configuration: group_replication_ssl_mode: "VERIFY_IDENTITY"
116 --let $grep_output= print_count
117 --source include/grep_pattern.inc
118
119 --source include/stop_group_replication.inc
120
121
122 --echo
123 --echo ############################################################
124 --echo # 6. Clean up.
125 --let $rpl_connection_name= server1
126 --source include/rpl_connection.inc
127 SET GLOBAL group_replication_ssl_mode= @group_replication_ssl_mode_save;
128
129 --let $rpl_connection_name= server2
130 --source include/rpl_connection.inc
131 SET GLOBAL group_replication_ssl_mode= @group_replication_ssl_mode_save;
132
133 --source include/group_replication_end.inc