| 1 |
################################################################################ |
| 2 |
# Bug#26142801: RECOVERY: SSL_VERIFY_SERVER_CERT AND SSL_ALLOWED ARE NOT RESET |
| 3 |
# BY GR VARIABLES |
| 4 |
# |
| 5 |
# Test verifies that both SSL_VERIFY_SERVER_CERT and SSL_ALLOWED variables are |
| 6 |
# SET and RESET appropriately. |
| 7 |
# |
| 8 |
# Test: |
| 9 |
# 0. The test requires two servers: M1 and M2. |
| 10 |
# 1. Bootstrap the first server M1. |
| 11 |
# 2. On M2 take a backup of existing ssl specific variables. |
| 12 |
# 3. Set group_replication_recovery_use_ssl and |
| 13 |
# group_replication_recovery_ssl_verify_server_cert variables. |
| 14 |
# 4. Verify using SHOW SLAVE STATUS that none of these options options are |
| 15 |
# enabled for recovery channel on M2. |
| 16 |
# 5. Verify that recovery cannot advance as SSL options are not configured |
| 17 |
# properly. |
| 18 |
# 6. Reset the above SSL variables and start the group replication once again. |
| 19 |
# 7. Verify that group is online and the above SSL variables are also set to |
| 20 |
# off. |
| 21 |
# 8. Clean up. |
| 22 |
################################################################################ |
| 23 |
--source include/have_group_replication_plugin.inc |
| 24 |
--let $rpl_skip_group_replication_start= 1 |
| 25 |
--source include/group_replication.inc |
| 26 |
|
| 27 |
--source include/start_and_bootstrap_group_replication.inc |
| 28 |
|
| 29 |
--let $rpl_connection_name= server2 |
| 30 |
--source include/rpl_connection.inc |
| 31 |
|
| 32 |
--echo # |
| 33 |
--echo # Make a copy of existing SSL options before modifying them. |
| 34 |
--echo # |
| 35 |
|
| 36 |
--let $conf_rec_retries= `SELECT @@GLOBAL.group_replication_recovery_retry_count;` |
| 37 |
--let $conf_rec_ssl_verify= `SELECT @@GLOBAL.group_replication_recovery_ssl_verify_server_cert;` |
| 38 |
--let $conf_rec_use_ssl= `SELECT @@GLOBAL.group_replication_recovery_use_ssl;` |
| 39 |
|
| 40 |
set session sql_log_bin=0; |
| 41 |
call mtr.add_suppression("There was an error when connecting to the donor*"); |
| 42 |
call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of Replica I/O for channel group_replication_recovery."); |
| 43 |
call mtr.add_suppression("Maximum number of retries when*"); |
| 44 |
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group."); |
| 45 |
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); |
| 46 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 47 |
set session sql_log_bin=1; |
| 48 |
|
| 49 |
--echo # |
| 50 |
--echo # Set group_replication_recovery_use_ssl & group_replication_recovery_ssl_verify_server_cert |
| 51 |
--echo # |
| 52 |
|
| 53 |
SET GLOBAL group_replication_recovery_retry_count = 1; |
| 54 |
SET GLOBAL group_replication_recovery_use_ssl = 1; |
| 55 |
SET GLOBAL group_replication_recovery_ssl_verify_server_cert = 1; |
| 56 |
|
| 57 |
--echo # |
| 58 |
--echo # Verify that none of the above SSL options are already set |
| 59 |
--echo # These options are only set when distributed recovery starts |
| 60 |
--echo # |
| 61 |
|
| 62 |
--let $rpl_channel_name= 'group_replication_recovery' |
| 63 |
--let $status_items= Master_SSL_Allowed, Master_SSL_Verify_Server_Cert |
| 64 |
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR |
| 65 |
--disable_warnings |
| 66 |
--source include/show_slave_status.inc |
| 67 |
--enable_warnings |
| 68 |
|
| 69 |
--echo # |
| 70 |
--echo # See when SSL is required that Recovery cannot advance when not properly configured |
| 71 |
--echo # |
| 72 |
|
| 73 |
--let $group_replication_start_member_state= ERROR |
| 74 |
--source include/start_group_replication.inc |
| 75 |
|
| 76 |
--echo # |
| 77 |
--echo # Verify that SSL options are shown in SHOW SLAVE STATUS output |
| 78 |
--echo # |
| 79 |
|
| 80 |
--let $rpl_channel_name= 'group_replication_recovery' |
| 81 |
--let $status_items= Master_SSL_Allowed, Master_SSL_Verify_Server_Cert |
| 82 |
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR |
| 83 |
--disable_warnings |
| 84 |
--source include/show_slave_status.inc |
| 85 |
--enable_warnings |
| 86 |
|
| 87 |
--source include/stop_group_replication.inc |
| 88 |
|
| 89 |
--echo # |
| 90 |
--echo # Reset SSL variables for recovery channel |
| 91 |
--echo # |
| 92 |
|
| 93 |
SET GLOBAL group_replication_recovery_use_ssl = default; # Default = 0. |
| 94 |
SET GLOBAL group_replication_recovery_ssl_verify_server_cert = default; # Default = 0. |
| 95 |
|
| 96 |
--echo # |
| 97 |
--echo # Verify that group replication member state is online. |
| 98 |
--echo # |
| 99 |
|
| 100 |
--let $group_replication_start_member_state= ONLINE |
| 101 |
--source include/start_group_replication.inc |
| 102 |
|
| 103 |
--echo # |
| 104 |
--echo # Verify that Master_SSL_Allowed and Master_SSL_Verify_Server_Cert are set to default. |
| 105 |
--echo # |
| 106 |
|
| 107 |
--let $rpl_channel_name= 'group_replication_recovery' |
| 108 |
--let $status_items= Master_SSL_Allowed, Master_SSL_Verify_Server_Cert |
| 109 |
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR |
| 110 |
--disable_warnings |
| 111 |
--source include/show_slave_status.inc |
| 112 |
--enable_warnings |
| 113 |
|
| 114 |
--echo # |
| 115 |
--echo # Clean up |
| 116 |
--echo # |
| 117 |
|
| 118 |
# No need to print this to the result file |
| 119 |
|
| 120 |
--disable_result_log |
| 121 |
--eval SET @@GLOBAL.group_replication_recovery_use_ssl= $conf_rec_use_ssl |
| 122 |
--eval SET @@GLOBAL.group_replication_recovery_ssl_verify_server_cert= $conf_rec_ssl_verify |
| 123 |
--eval SET @@GLOBAL.group_replication_recovery_retry_count= $conf_rec_retries |
| 124 |
--enable_result_log |
| 125 |
|
| 126 |
--source include/group_replication_end.inc |