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