| 1 |
## Test cases for authorization against an unsupported plugin |
| 2 |
|
| 3 |
--let $dont_reset_global_status_variables= 1 |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/have_mysql_no_login_plugin.inc |
| 6 |
--source include/xplugin_create_user.inc |
| 7 |
|
| 8 |
call mtr.add_suppression("Maximum number of authentication attempts reached, login failed"); |
| 9 |
call mtr.add_suppression("Access denied for user .*"); |
| 10 |
|
| 11 |
## Test starts here |
| 12 |
|
| 13 |
--let $xtest_file= $MYSQL_TMP_DIR/connection_auth_plugin_unsupported.xpl |
| 14 |
--write_file $xtest_file |
| 15 |
-->quiet |
| 16 |
-->sql |
| 17 |
SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', ''); |
| 18 |
SHOW STATUS LIKE 'Mysqlx_ssl_active'; |
| 19 |
-->endsql |
| 20 |
EOF |
| 21 |
|
| 22 |
--replace_regex /\.dll/.so/ |
| 23 |
--eval INSTALL PLUGIN test_plugin_server SONAME '$PLUGIN_AUTH' |
| 24 |
--replace_regex /\.dll/.so/ |
| 25 |
--eval INSTALL PLUGIN mysql_no_login SONAME '$MYSQL_NO_LOGIN' |
| 26 |
|
| 27 |
|
| 28 |
CREATE USER xuser_test@localhost |
| 29 |
IDENTIFIED WITH 'test_plugin_server' BY 'test'; |
| 30 |
GRANT ALL ON *.* TO xuser_test@localhost; |
| 31 |
|
| 32 |
CREATE USER xuser_nologin@localhost |
| 33 |
IDENTIFIED WITH 'mysql_no_login' BY 'nologin'; |
| 34 |
GRANT ALL ON *.* TO xuser_nologin@localhost; |
| 35 |
|
| 36 |
--echo Show users |
| 37 |
SELECT user, plugin FROM mysql.user WHERE user LIKE 'xuser%'; |
| 38 |
|
| 39 |
|
| 40 |
--let $XBASIC= --file=$xtest_file 2>&1 |
| 41 |
--let $XSSLPARAM= --ssl-cipher='ECDHE-RSA-AES128-GCM-SHA256' $XBASIC |
| 42 |
|
| 43 |
--exec $MYSQLXTEST -ux_root $XBASIC |
| 44 |
--exec $MYSQLXTEST -ux_root $XSSLPARAM |
| 45 |
|
| 46 |
--echo Ssl connection by test plugin -> fail |
| 47 |
--exec $MYSQLXTEST --expect-error ER_ACCESS_DENIED_ERROR -uxuser_test -ptest $XSSLPARAM |
| 48 |
|
| 49 |
--echo Plain connection by test plugin -> fail |
| 50 |
--exec $MYSQLXTEST --expect-error 2510 -uxuser_test -ptest $XBASIC |
| 51 |
|
| 52 |
--echo Ssl connection by no_login plugin -> fail |
| 53 |
--exec $MYSQLXTEST --expect-error ER_ACCESS_DENIED_ERROR -uxuser_nologin -pnologin $XSSLPARAM |
| 54 |
|
| 55 |
--echo Ssl connection by no_login plugin -> fail |
| 56 |
--exec $MYSQLXTEST --expect-error ER_ACCESS_DENIED_ERROR -uxuser_nologin -pnologin $XSSLPARAM |
| 57 |
|
| 58 |
## Cleanup |
| 59 |
DROP USER xuser_test@localhost; |
| 60 |
DROP USER xuser_nologin@localhost; |
| 61 |
UNINSTALL PLUGIN test_plugin_server; |
| 62 |
UNINSTALL PLUGIN mysql_no_login; |
| 63 |
--source ../include/xplugin_cleanup.inc |