| 1 |
## This is test file for connection authentication using mysqlx. |
| 2 |
## |
| 3 |
--source include/not_windows.inc |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
|
| 7 |
create user nonblank@localhost identified by 'nonblank'; |
| 8 |
|
| 9 |
--write_file $MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl |
| 10 |
-->sql |
| 11 |
select user(),current_user(),@@bind_address; |
| 12 |
-->endsql |
| 13 |
EOF |
| 14 |
|
| 15 |
--echo Test starts here |
| 16 |
--disable_query_log |
| 17 |
--disable_result_log |
| 18 |
let $restart_parameters = restart: --skip-networking; |
| 19 |
let $XPLUGIN_SOCKET=$MASTER_X_MYSOCK; |
| 20 |
|
| 21 |
--replace_regex /restart: .+$XPLUGIN_SOCKE/restart: --skip-networking/ |
| 22 |
--let $wait_for_tcpsocket_status = undefined_value |
| 23 |
--source include/restart_mysqld.inc |
| 24 |
|
| 25 |
--enable_query_log |
| 26 |
--enable_result_log |
| 27 |
|
| 28 |
--echo # Verify that UNIX socket connection still works |
| 29 |
exec $MYSQLXTEST |
| 30 |
-u x_root --password='' |
| 31 |
--socket=$XPLUGIN_SOCKET |
| 32 |
--file=$MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl 2>&1; |
| 33 |
|
| 34 |
--echo # Verify that TCP is disabled |
| 35 |
--replace_regex /error: .+:[0-9]+/ERROR: Connection refused connecting to localhost:PORT/ |
| 36 |
exec $MYSQLXTEST |
| 37 |
-u x_root --password='' |
| 38 |
--expect-error 2002 |
| 39 |
--file=$MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl 2>&1; |
| 40 |
|
| 41 |
--echo # Try login using mysqlx protocol when server started with skip-networking options and mysqlx loaded with non super user |
| 42 |
--replace_regex /error: .+:[0-9]+/ERROR: Connection refused connecting to localhost:PORT/ |
| 43 |
exec $MYSQLXTEST |
| 44 |
-u nonblank --password='nonblank' |
| 45 |
--expect-error 2002 |
| 46 |
--file=$MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl 2>&1; |
| 47 |
|
| 48 |
|
| 49 |
call mtr.add_suppression("Plugin mysqlx reported: .Preparation of I/O interfaces failed, X Protocol won't be accessible"); |
| 50 |
call mtr.add_suppression("Plugin mysqlx reported: .X Plugin failed to setup .+ .., with:"); |
| 51 |
call mtr.add_suppression("Plugin mysqlx reported: .+ path is empt"); |
| 52 |
call mtr.add_suppression("Plugin mysqlx reported: .+ is set to empty text"); |
| 53 |
|
| 54 |
let $restart_parameters = $restart_parameters --loose-mysqlx-socket=; |
| 55 |
--replace_regex /restart: .+--loose-mysqlx-socket=/restart: --skip-networking --loose-mysqlx-socket=/ |
| 56 |
|
| 57 |
--let $wait_for_tcpsocket_status = undefined_value |
| 58 |
--let $wait_for_unixsocket_status = undefined_value |
| 59 |
--source include/restart_mysqld.inc |
| 60 |
|
| 61 |
--disable_result_log |
| 62 |
--echo # Verify that TCP is disabled |
| 63 |
--error 1 |
| 64 |
--exec $MYSQLXTEST -u x_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl 2>&1 |
| 65 |
|
| 66 |
--echo # Verify that UNIX socket is disabled |
| 67 |
--error 1 |
| 68 |
--exec $MYSQLXTEST -u x_root --password='' --socket=$XPLUGIN_SOCKET --file=$MYSQL_TMP_DIR/mysqlx-connection_current_user.xpl 2>&1 |
| 69 |
|
| 70 |
--disable_query_log |
| 71 |
let $restart_parameters = restart:; |
| 72 |
--source include/restart_mysqld.inc |
| 73 |
--enable_query_log |
| 74 |
--enable_result_log |
| 75 |
|
| 76 |
## Cleanup |
| 77 |
drop user nonblank@localhost; |
| 78 |
--source ../include/xplugin_cleanup.inc |