| 1 |
## Preamble |
| 2 |
--source include/xplugin_preamble.inc |
| 3 |
--source include/xplugin_create_user.inc |
| 4 |
|
| 5 |
## Test starts here |
| 6 |
--echo |
| 7 |
--echo ## Test shows that user can DISABLE/ENABLE ServerHello notice |
| 8 |
--echo ## using 'mysqlx_enable_hello_notice' variable: |
| 9 |
--echo # |
| 10 |
--echo # 1. Verify raw connection to X Plugin with ServerHello notice on |
| 11 |
--echo # 2. Verify raw connection to X Plugin with ServerHello notice off |
| 12 |
--echo # 3. Verify SSL connection to X Plugin with ServerHello notice on |
| 13 |
--echo # 4. Verify SSL connection to X Plugin with ServerHello notice off |
| 14 |
--echo # 5. Unprivileged user fails to change ServerHello notice configuration; |
| 15 |
--echo # |
| 16 |
|
| 17 |
--write_file $MYSQL_TMP_DIR/mysqlx-hello-notice.xpl |
| 18 |
-->import connection.macro |
| 19 |
|
| 20 |
echo; |
| 21 |
echo #; |
| 22 |
echo # 1. Raw connection to X Plugin with ServerHello notice on; |
| 23 |
SET GLOBAL mysqlx_enable_hello_notice= TRUE; |
| 24 |
|
| 25 |
newsession attempt1 -; |
| 26 |
callmacro Verify_its_xprotocol_connection_with_result; |
| 27 |
login x_root test mysql41; |
| 28 |
|
| 29 |
echo; |
| 30 |
echo #; |
| 31 |
echo # 2. Raw connection to X Plugin with ServerHello notice off; |
| 32 |
SET GLOBAL mysqlx_enable_hello_notice= FALSE; |
| 33 |
|
| 34 |
newsession attempt2 -; |
| 35 |
login x_root test mysql41; |
| 36 |
|
| 37 |
echo; |
| 38 |
echo #; |
| 39 |
echo # 3. SSL connection to X Plugin with ServerHello notice on; |
| 40 |
|
| 41 |
SET GLOBAL mysqlx_enable_hello_notice= TRUE; |
| 42 |
|
| 43 |
newsession attempt3 -; |
| 44 |
callmacro Verify_its_xprotocol_connection_with_result; |
| 45 |
callmacro Enable_ssl_on_xprotocol_and_transmision_layer; |
| 46 |
login x_root test mysql41; |
| 47 |
|
| 48 |
echo; |
| 49 |
echo #; |
| 50 |
echo # 4. SSL connection to X Plugin with ServerHello notice off; |
| 51 |
|
| 52 |
SET GLOBAL mysqlx_enable_hello_notice= FALSE; |
| 53 |
|
| 54 |
newsession attempt4 -; |
| 55 |
callmacro Enable_ssl_on_xprotocol_and_transmision_layer; |
| 56 |
login x_root test mysql41; |
| 57 |
|
| 58 |
echo; |
| 59 |
echo #; |
| 60 |
echo # 5. Unprivileged user tries to enable ServerHello notice; |
| 61 |
SET GLOBAL mysqlx_enable_hello_notice= FALSE; |
| 62 |
|
| 63 |
newsession attempt5 some_user; |
| 64 |
expecterror ER_SPECIFIC_ACCESS_DENIED_ERROR; |
| 65 |
SET GLOBAL mysqlx_enable_hello_notice= TRUE; |
| 66 |
|
| 67 |
EOF |
| 68 |
|
| 69 |
CREATE USER 'some_user' @'localhost' IDENTIFIED WITH 'mysql_native_password'; |
| 70 |
|
| 71 |
exec $MYSQLXTEST |
| 72 |
-ux_root --password='' |
| 73 |
--ssl-mode=REQUIRED |
| 74 |
--file=$MYSQL_TMP_DIR/mysqlx-hello-notice.xpl 2>&1; |
| 75 |
|
| 76 |
## Cleanup |
| 77 |
SET GLOBAL mysqlx_enable_hello_notice= DEFAULT; |
| 78 |
DROP USER 'some_user' @'localhost'; |
| 79 |
--source ../include/xplugin_cleanup.inc |
| 80 |
|