Debian Codegraph @

mysql-test/suite/x/t/connection_require_secure_transport.test

raw
1 ## UNIX Socket connections
2
3 ## Preamble
4 --source include/not_windows.inc
5 --source include/xplugin_preamble.inc
6 --source include/xplugin_create_user.inc
7
8 --write_file $MYSQL_TMP_DIR/check_plain_connection.xpl
9 -->import connection.macro
10 -->callmacro Verify_its_xprotocol_connection
11 Mysqlx.Session.AuthenticateStart {
12 mech_name: "PLAIN"
13 auth_data: "\0x_root\0"
14 }
15 -->recvuntil Mysqlx.Session.AuthenticateOk do_not_show_intermediate
16 EOF
17
18 --write_file $MYSQL_TMP_DIR/check_connection.xpl
19 EOF
20
21 --write_file $MYSQL_TMP_DIR/check_ssl_plain_connection.xpl
22 -->import connection.macro
23 -->callmacro Verify_its_xprotocol_connection
24 -->callmacro Enable_ssl_on_xprotocol_and_transmision_layer
25
26 Mysqlx.Session.AuthenticateStart {
27 mech_name: "PLAIN"
28 auth_data: "\0x_root\0"
29 }
30 -->recvuntil Mysqlx.Session.AuthenticateOk do_not_show_intermediate
31 EOF
32
33 --echo Wait for the X Plugin before restarting the server
34 --exec $MYSQLXTEST -q -ux_root --password='' --file=$MYSQL_TMP_DIR/check_connection.xpl 2>&1
35
36 --echo Test different connection types while secure transport when the server was started with this flag set to ON
37 # Cases when the flag is dynamicly changes is tests in related x test file (for example connection_ssl.test)
38 let $restart_parameters = restart: --require_secure_transport=ON;
39 --source include/restart_mysqld.inc
40
41 --exec $MYSQLXTEST -n --socket=$MASTER_X_MYSOCK -ux_root --password='' --file=$MYSQL_TMP_DIR/check_plain_connection.xpl 2>&1
42 --exec $MYSQLXTEST -n -ux_root --password='' --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --file=$MYSQL_TMP_DIR/check_ssl_plain_connection.xpl 2>&1
43
44 --error 1
45 --exec $MYSQLXTEST -n -ux_root --password='' --file=$MYSQL_TMP_DIR/check_plain_connection.xpl 2>&1
46
47 --exec $MYSQLXTEST --expect-error ER_SECURE_TRANSPORT_REQUIRED -ux_root --password='' --file=$MYSQL_TMP_DIR/check_connection.xpl 2>&1
48
49 SET GLOBAL require_secure_transport=OFF;
50
51 --error 1
52 --exec $MYSQLXTEST -n -ux_root --password='' --file=$MYSQL_TMP_DIR/check_plain_connection.xpl 2>&1
53 --exec $MYSQLXTEST -n --socket=$MASTER_X_MYSOCK -ux_root --password='' --file=$MYSQL_TMP_DIR/check_plain_connection.xpl 2>&1
54 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/check_connection.xpl 2>&1
55
56 ## Cleanup
57 --source ../include/xplugin_cleanup.inc