Debian Codegraph @

mysql-test/suite/auth_sec/t/ssl_auto_detect_openssl.test

raw
1 # Save the initial number of concurrent sessions
2 --source include/count_sessions.inc
3
4
5 #------------------------------------------------------------------------------
6
7
8 --echo # Global Setup
9 call mtr.add_suppression("Failed to initialize TLS for channel: mysql_main");
10 call mtr.add_suppression("Failed to setup SSL");
11 call mtr.add_suppression(".*SSL_CTX_set_default_verify_paths failed");
12 let DATADIR_LOCATION=$MYSQLTEST_VARDIR/mysqld.1/data;
13 let server_log= $MYSQLTEST_VARDIR/log/ssl_auto_detect_openssl.err;
14 let CERTDIR_LOCATION=$MYSQLTEST_VARDIR/tmp/certs;
15 let CADIR_LOCATION=$MYSQLTEST_VARDIR/tmp/certs/cacerts;
16
17 --error 0, 1
18 --rmdir $CADIR_LOCATION
19 --error 0, 1
20 --rmdir $CERTDIR_LOCATION
21
22 --mkdir $CERTDIR_LOCATION
23 --copy_file std_data/server-cert.pem $CERTDIR_LOCATION/server-cert.pem
24 --copy_file std_data/server-key.pem $CERTDIR_LOCATION/server-key.pem
25
26 --mkdir $CADIR_LOCATION
27 --copy_file std_data/cacert.pem $CADIR_LOCATION/ca.pem
28 --copy_file std_data/untrusted-cacert.pem $CADIR_LOCATION/ca2.pem
29
30 let SEARCH_FILE= $server_log;
31
32
33 #------------------------------------------------------------------------------
34
35
36 --echo # Case 1 : Check that all certificates in --ssl-capath are processed.
37
38 let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
39 --exec echo "wait" > $restart_file
40 --shutdown_server
41 --source include/wait_until_disconnected.inc
42
43 --exec echo "restart: --log-error=$server_log --ssl-capath=$CADIR_LOCATION --ssl-ca=$CADIR_LOCATION/ca.pem --ssl-cert=$CERTDIR_LOCATION/server-cert.pem --ssl-key=$CERTDIR_LOCATION/server-key.pem" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
44 --enable_reconnect
45 --source include/wait_until_connected_again.inc
46 --disable_reconnect
47 --echo # Restart completed.
48
49 --echo # Search for : CA certificate *ca.pem is self signed.
50 let SEARCH_PATTERN= CA certificate .*ca.pem is self signed.;
51 --source include/search_pattern.inc
52 --echo # Search for : CA certificate *ca2.pem is self signed.
53 let SEARCH_PATTERN= CA certificate .*ca2.pem is self signed.;
54 --source include/search_pattern.inc
55
56 #------------------------------------------------------------------------------
57
58
59 --echo # Global Cleanup
60 --remove_file $CADIR_LOCATION/ca.pem
61 --remove_file $CADIR_LOCATION/ca2.pem
62 --rmdir $CADIR_LOCATION
63 --remove_file $CERTDIR_LOCATION/server-cert.pem
64 --remove_file $CERTDIR_LOCATION/server-key.pem
65 --rmdir $CERTDIR_LOCATION
66
67 # Wait till all disconnects are completed
68 --source include/wait_until_count_sessions.inc
69
70
71 #------------------------------------------------------------------------------
72
73 # Restore default settings in opt file
74 --let $restart_parameters = restart:
75 --source include/restart_mysqld.inc