Debian Codegraph @

mysql-test/suite/rpl/t/rpl_fips.test

raw
1 # ==== Requirements ====
2 # #
3 # # R1. When @@global.ssl_fips=1, and replication does not use ssl, replication shall work
4 # # R2. When @@global.ssl_fips=1, and replication uses ssl with a weak cipher, replication shall fail to connect
5 # # R3. When @@global.ssl_fips=1, and replication uses ssl with a strong cipher, replication shall work
6 # #
7 # # ==== References ====
8 # #
9 # # WL#8102: Make sure MySQL compiles and runs with the OpenSSL FIPS Object Module
10
11 # Disabled on 32-bit platforms until Bug#28556707 is fixed
12 --source include/have_64bit.inc
13 --source include/not_windows.inc
14 --source include/have_fips.inc
15 --source include/not_group_replication_plugin.inc
16 --source include/master-slave.inc
17
18 CALL mtr.add_suppression("Failed to set up SSL because of the following *");
19 CALL mtr.add_suppression("Replica SQL for channel '': Request to stop replica SQL Thread received while *");
20
21 --echo [on master]
22 connection master;
23 SET PERSIST_ONLY ssl_fips_mode=ON;
24
25 --echo [on slave]
26 connection slave;
27 SET PERSIST_ONLY ssl_fips_mode=ON;
28
29 # Restart master
30 --source include/stop_slave.inc
31 --let $rpl_server_number=1
32 --source include/rpl_restart_server.inc
33 --source include/start_slave.inc
34 --source include/rpl_connection_master.inc
35 --source include/save_binlog_position.inc
36
37 --echo [on master]
38 connection master;
39
40 --echo [on slave]
41 connection slave;
42 source include/stop_slave.inc;
43 --let $rpl_server_number=2
44 --source include/rpl_restart_server.inc
45 --echo # R1: Set the ssl connection OFF
46 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
47 --eval CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL = 0;
48 source include/start_slave.inc;
49 --source include/check_slave_no_error.inc
50
51 --echo [on slave]
52 connection slave;
53 source include/stop_slave.inc;
54 --echo # R2: Set the ssl connection ON and weak cipher CAMELLIA256-SHA
55 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
56 --eval CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL = 1, SOURCE_TLS_VERSION = 'TLSv1.2', SOURCE_SSL_CIPHER = 'CAMELLIA256-SHA', SOURCE_RETRY_COUNT = 1
57 START SLAVE;
58 --let $slave_io_errno= 2026
59 --source include/wait_for_slave_io_error.inc
60 connection slave;
61 select SERVICE_STATE, LAST_ERROR_NUMBER from performance_schema.replication_connection_status;
62
63 --echo # R3: Set the ssl connection ON and strong cipher
64 connection slave;
65 --source include/stop_slave.inc
66 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
67 --eval CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL = 1, SOURCE_TLS_VERSION = 'TLSv1.2', SOURCE_SSL_CIPHER = 'ECDHE-RSA-AES128-GCM-SHA256'
68 source include/start_slave.inc;
69 --source include/check_slave_no_error.inc
70
71 --source include/stop_slave.inc
72
73 --echo ==== Cleanup (Note that slave IO thread is not running) ====
74 # cleanup: slave io thread has stopped so we reset replication
75 --replace_column 2 ####
76 CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL=0;
77
78 # clear Slave_IO_Errno
79 --let $rpl_only_running_threads= 1
80 --source include/rpl_reset.inc
81
82 --echo [on master]
83 connection master;
84 RESET PERSIST ssl_fips_mode;
85 let $MYSQLD_DATADIR= `select @@datadir`;
86 --remove_file $MYSQLD_DATADIR/mysqld-auto.cnf
87
88 --echo [on slave]
89 connection slave;
90 RESET PERSIST ssl_fips_mode;
91 let $MYSQLD_DATADIR= `select @@datadir`;
92 --remove_file $MYSQLD_DATADIR/mysqld-auto.cnf
93
94 --echo [on master]
95 connection master;
96
97 --source include/rpl_end.inc
98 --source include/force_restart.inc