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/admin_kill_client_mysqlx.test

## Kill client

create user unpriv@localhost;
set password for unpriv@localhost = password('x');

--source ../include/xplugin_preamble.inc

## Test starts here
--let $xtest_file= $MYSQL_TMP_DIR/admin_kill_mysqlx.tmp
--write_file $xtest_file
-->quiet
## Test data

-->varlet %CLIENT_ID1% %ACTIVE_CLIENT_ID%

-->stmtadmin list_clients
-->recvresult

-->stmtadmin list_clients	{"what":"all"}
-->expecterror 5015
-->recvresult


## create and activate new session
-->newsession aux	root

-->varlet %CLIENT_ID2% %ACTIVE_CLIENT_ID%

-->stmtadmin list_clients
-->recvresult

## switch back to default session
-->setsession

-->stmtadmin list_clients
-->recvresult

-->stmtadmin kill_client
-->expecterror 5015
-->recvresult


-->stmtadmin kill_client	{"id": %CLIENT_ID2% }
-->recvresult

-->sleep 1


-->stmtadmin list_clients
-->recvresult


### Create a separate session with diff account
-->newsession unpriv	unpriv	x

-->varlet %CLIENT_ID3% %ACTIVE_CLIENT_ID%

-->echo Should list unprivs session only
-->stmtadmin list_clients
-->recvresult


## Try to kill a root session from unpriv
-->stmtadmin kill_client	{"id": %CLIENT_ID1% }
-->expecterror 1095
-->recvresult

-->setsession

-->sleep 1;


## Should list all sessions
-->stmtadmin list_clients
-->recvresult


## kill the unpriv session
-->stmtadmin kill_client	{"id": %CLIENT_ID3% }
-->recvresult

-->sleep 1;


## Should list only root session
-->stmtadmin list_clients
-->recvresult
EOF

--replace_regex /([a-z]*.+localhost[ 	]+)[0-9]+/\1$SESSION/ /You are not owner of thread [0-9]+/You are not owner of thread/
--exec $MYSQLXTEST -uroot --password='' --file=$xtest_file 2>&1

## Postamble
--remove_file $xtest_file
drop user unpriv@localhost;
uninstall plugin mysqlx;

Man Man