Debian Codegraph @

mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test

raw
1 #
2 # This test checks that if SST SSL is not explicitly configured mariabackup SST
3 # uses server SSL configuration if present.
4 # Initial SST happens via mariabackup, so there is not much to do in the body
5 # of the test
6 #
7
8 --source include/galera_cluster.inc
9 --source include/have_innodb.inc
10 --source include/have_mariabackup.inc
11 --source include/have_ssl_communication.inc
12
13 SELECT 1;
14
15 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
16 --source include/wait_condition.inc
17
18 # Confirm that transfer was SSL-encrypted
19 --let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
20 --let SEARCH_PATTERN = Using openssl based encryption with socat: with key and crt
21 --source include/search_pattern_in_file.inc
22
23 --echo #
24 --echo # MDEV-39413 wsrep unsafe handling of parameters
25 --echo #
26
27 call mtr.add_suppression('Invalid value for WSREP_SST_OPT_REMOTE_USER');
28 call mtr.add_suppression('Failed to read from: wsrep_sst_mariabackup');
29 call mtr.add_suppression('Process completed with error: wsrep_sst_mariabackup');
30 call mtr.add_suppression('Command did not run: wsrep_sst_mariabackup');
31 call mtr.add_suppression('State transfer to .* failed');
32 call mtr.add_suppression('Will never receive state. Need to abort');
33 call mtr.add_suppression('Error while getting data from donor node');
34 call mtr.add_suppression('Cleanup after exit with status');
35 call mtr.add_suppression('Removing .*/xtrabackup_galera_info file due to signal');
36
37 --connection node_2
38 --source include/shutdown_mysqld.inc
39
40 --echo # force SST again
41 --remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
42 --echo # using a cert with shell-unsafe CN
43 --exec echo '[mysqld.2]' >> $MYSQLTEST_VARDIR/my.cnf
44 --exec echo ssl-cert=$MYSQL_TEST_DIR/std_data/server-new-cert.pem >> $MYSQLTEST_VARDIR/my.cnf
45 --exec echo ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem >> $MYSQLTEST_VARDIR/my.cnf
46
47 --echo # start the server
48 # Joiner mariadbd exits when SST is aborted; the exit code varies by
49 # platform (clean 0 on some systems, signalled 134 / 1 on others).
50 --error 0,134,1
51 --exec $MYSQLD_LAST_CMD
52 --echo # the server failed to start
53
54 --let SEARCH_PATTERN = Invalid value for WSREP_SST_OPT_REMOTE_USER
55 --source include/search_pattern_in_file.inc
56
57 --echo # cleanup
58 # we have to kill joiner's socat here, because the donor has aborted SST
59 # and joiner's socat will timeout in 5 minutes
60 # pkill exit code varies by platform 0 or 1
61 --error 0,1
62 --exec pkill -f 'socat.*server-new-cert'
63 --exec echo ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem >> $MYSQLTEST_VARDIR/my.cnf
64 --exec echo ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem >> $MYSQLTEST_VARDIR/my.cnf
65 --source $MYSQL_TEST_DIR/include/start_mysqld.inc
66
67 --connection node_2
68 call mtr.add_suppression("Removing");