config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/x/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/x/t/connection_unixsocket_invalid.test

## UNIX Socket connections

## Preamble
--source include/not_windows.inc
--source ../include/have_performance_schema_threads.inc
--source ../include/xplugin_preamble.inc

## Test starts here
--write_file $MYSQL_TMP_DIR/check_unixsocket.tmp
## Test data
#Ensure that each of following uses UNIX Socket
-->stmtsql SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query';
-->recvresult
EOF

--write_file $MYSQL_TMP_DIR/create_socket_on_this_file.tmp
EOF

--write_file $MYSQL_TMP_DIR/check_connection.tmp
EOF

--exec $MYSQLXTEST --socket=$MASTER_X_MYSOCK -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1

# Read only variable 'mysqlx_socket'
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL mysqlx_socket=null;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.mysqlx_socket='invalid';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL mysqlx_socket=$MYSQL_TMP_DIR/socket_mysqlx.sock;

call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket .. failed, the socket file path is empty");
let $restart_parameters = restart: --loose-mysqlx-socket=;
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: No such file or directory, while connecting to .+\.sock/ERROR: No such file or directory connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket=$MASTER_X_MYSOCK -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1


call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket ./dev/null/mysqlx\.sock. failed, can't create lock file /dev/null/mysqlx\.sock\.lock");
let $restart_parameters = restart: --loose-mysqlx-socket="/dev/null/mysqlx.sock";
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: No such file or directory, while connecting to .+\.sock/ERROR: No such file or directory connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket=$MASTER_X_MYSOCK -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1

--replace_regex /ERROR: Not a directory, while connecting to .+\.sock/ERROR: Not a directory, while connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket="/dev/null/mysqlx.sock" -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1

# Use the same socket as mysqld uses
# X Plugin should fail with allocation
--disable_query_log
eval call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket .$MASTER_MYSOCK. failed, lock file wasn't allocated by X Plugin");
--enable_query_log
UNINSTALL PLUGIN mysqlx;
--replace_regex /loose-mysqlx-socket=.*sock/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MASTER_MYSOCK;

# There is no X Plugin installed, skip waiting
--let $wait_for_tcpsocket_status = no_wait
--let $wait_for_unixsocket_status = no_wait
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--let $wait_for_unixsocket_status = undefined_value
 --source ../include/xplugin_install_and_wait.inc

# The legacy UNIX socket should be still valid
connect(socket_con,localhost,root,,,,$MASTER_MYSOCK);
connection default;
disconnect socket_con;


# Try to use a file as UNIX socket
--replace_regex /loose-mysqlx-socket=.*tmp/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/create_socket_on_this_file.tmp;
--let $wait_for_unixsocket_status = valid_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/create_socket_on_this_file.tmp -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1


# Try to use directory as UNIX socket
call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket ..+/directory. failed, .bind... on UNIX socket failed with error");
--mkdir $MYSQL_TMP_DIR/directory
--replace_regex /loose-mysqlx-socket=.*directory/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/directory;
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: (Connection refused, while connecting to|Socket operation on non-socket, while connecting to) .+directory/ERROR: Connection refused, while connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/directory -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1


# Try to create a UNIX socket inside directory without permissions to it
call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket ..+/directory/mysqlx.socket. failed, can't create lock file .*directory/mysqlx.socket.lock");
--chmod 0000 $MYSQL_TMP_DIR/directory/
--replace_regex /loose-mysqlx-socket=.*socket/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/directory/mysqlx.socket;
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: Permission denied, while connecting to .+\.socket/ERROR: Permission denied, while connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/directory/mysqlx.socket -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1
--chmod 0777 $MYSQL_TMP_DIR/directory/


call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket ..+/no_existing/mysqlx.socket. failed, can't create lock file .*no_existing/mysqlx.socket.lock");
--replace_regex /loose-mysqlx-socket=.*socket/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/directory/no_existing/mysqlx.socket;
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: No such file or directory, while connecting to .+\.socket/ERROR: No such file or directory connecting to SOCKET/
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/directory/no_existing/mysqlx.socket -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1


--mkdir $MYSQL_TMP_DIR/long_dir012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
call mtr.add_suppression("Plugin mysqlx reported: .Setup of UNIX socket ..+/mysqlx.socket. failed, the socket file path is too long");
--replace_regex /loose-mysqlx-socket=.*socket/loose-mysqlx-socket=SOCKET/
let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/long_dir012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/mysqlx.socket;
--let $wait_for_unixsocket_status = undefined_value
--source ../include/restart_mysqld_and_wait_for_xplugin.inc

--replace_regex /ERROR: UNIX Socket file name too long, size should be less or equal [0-9]+/ERROR: UNIX Socket file name too long, size should be less or equal LENGTH/
--error 1
--exec $MYSQLXTEST --socket=$MYSQL_TMP_DIR/long_dir012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/mysqlx.socket -uroot --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.tmp 2>&1

## Postamble
--remove_file $MYSQL_TMP_DIR/check_unixsocket.tmp
--remove_file $MYSQL_TMP_DIR/check_connection.tmp
--rmdir $MYSQL_TMP_DIR/directory
--rmdir $MYSQL_TMP_DIR/long_dir012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

UNINSTALL PLUGIN mysqlx;

Man Man