polardbxengine/mysql-test/suite/x/t/connection_unixsocket_lock....

76 lines
2.9 KiB
Plaintext

## UNIX Socket connections
## Preamble
--source include/not_windows.inc
--source ../include/have_performance_schema_threads.inc
--source include/xplugin_preamble.inc
--source include/xplugin_create_user.inc
## Test starts here
--write_file $MYSQL_TMP_DIR/check_unixsocket.tmp
## Test data
#Ensure that each of following uses UNIX Socket
-->quiet
-->wait_for 1 SELECT count(*) from performance_schema.threads WHERE PROCESSLIST_COMMAND='Query' AND CONNECTION_TYPE='Socket';
EOF
--write_file $MYSQL_TMP_DIR/check_connection.tmp
EOF
--exec $MYSQLXTEST --socket=$MASTER_X_MYSOCK -ux_root --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1
--echo Test lock file issue
--write_file $MYSQL_TMP_DIR/mysqlx.custom.lock
EOF
--let UNIX_SOCKET_REGEX= / \/.*\.(custom|socket) / SOCKET /
call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.custom' failed, lock file is empty");
--replace_regex /loose-mysqlx-socket=.*custom/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.custom;
--let $wait_for_unixsocket_status = undefined_value
--source include/restart_mysqld.inc
--replace_regex $UNIX_SOCKET_REGEX
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/mysqlx.custom -ux_root --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1
--mkdir $MYSQL_TMP_DIR/mysqlx.dir.socket.lock
call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.dir.socket' failed, can't read lock file");
call mtr.add_suppression("Plugin mysqlx reported: .* wasn't allocated by X Plugin ..+/mysqlx.dir.socket.lock");
--replace_regex /loose-mysqlx-socket=.*socket/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.dir.socket;
--let $wait_for_unixsocket_status = undefined_value
--source include/restart_mysqld.inc
--replace_regex $UNIX_SOCKET_REGEX
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/mysqlx.dir.socket -ux_root --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1
--remove_file $MYSQL_TMP_DIR/mysqlx.custom.lock
--write_file $MYSQL_TMP_DIR/mysqlx.custom.lock
Xinvalid_number
EOF
call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.custom' failed, invalid PID in UNIX socket lock file ");
--replace_regex /loose-mysqlx-socket=.*custom/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.custom;
--let $wait_for_unixsocket_status = undefined_value
--source include/restart_mysqld.inc
--replace_regex $UNIX_SOCKET_REGEX
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/mysqlx.custom -ux_root --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1
## Cleanup
--remove_file $MYSQL_TMP_DIR/check_unixsocket.tmp
--remove_file $MYSQL_TMP_DIR/check_connection.tmp
--remove_file $MYSQL_TMP_DIR/mysqlx.custom.lock
--rmdir $MYSQL_TMP_DIR/mysqlx.dir.socket.lock
--source include/xplugin_drop_user.inc