| 1 |
CREATE USER xuser_native@'localhost' |
| 2 |
IDENTIFIED WITH 'mysql_native_password' BY 'native'; |
| 3 |
CREATE USER xuser_sha256@'localhost' |
| 4 |
IDENTIFIED WITH 'sha256_password' BY 'sha256'; |
| 5 |
CREATE USER xuser_cache2@'localhost' |
| 6 |
IDENTIFIED WITH 'caching_sha2_password' BY 'cache2'; |
| 7 |
GRANT ALL ON *.* TO xuser_native@localhost; |
| 8 |
GRANT ALL ON *.* TO xuser_sha256@localhost; |
| 9 |
GRANT ALL ON *.* TO xuser_cache2@localhost; |
| 10 |
|
| 11 |
####################################################################### |
| 12 |
## 1. Memory mechanism fails |
| 13 |
## |
| 14 |
## when: |
| 15 |
## * The cache is empty |
| 16 |
## * The the mysqlx_cache_cleaner plugin is not installed |
| 17 |
## then the cache is not filled with data. |
| 18 |
## |
| 19 |
## Requirements: F1 |
| 20 |
# |
| 21 |
####################################################################### |
| 22 |
# Cache is empty, the sha256_memory request must fail |
| 23 |
-- Expecting failure with parameters: DISABLED memory xuser_native native |
| 24 |
-- |
| 25 |
connecting... |
| 26 |
Got expected error (one of: 1045 2510 ) |
| 27 |
-- Expecting failure with parameters: DISABLED memory xuser_sha256 sha256 |
| 28 |
-- |
| 29 |
connecting... |
| 30 |
Got expected error (one of: 1045 2510 ) |
| 31 |
-- Expecting failure with parameters: DISABLED memory xuser_cache2 cache2 |
| 32 |
-- |
| 33 |
connecting... |
| 34 |
Got expected error (one of: 1045 2510 ) |
| 35 |
-- Expecting failure with parameters: REQUIRED memory xuser_native native |
| 36 |
-- |
| 37 |
connecting... |
| 38 |
Got expected error (one of: 1045 2510 ) |
| 39 |
-- Expecting failure with parameters: REQUIRED memory xuser_sha256 sha256 |
| 40 |
-- |
| 41 |
connecting... |
| 42 |
Got expected error (one of: 1045 2510 ) |
| 43 |
-- Expecting failure with parameters: REQUIRED memory xuser_cache2 cache2 |
| 44 |
-- |
| 45 |
connecting... |
| 46 |
Got expected error (one of: 1045 2510 ) |
| 47 |
Mysqlx.Ok { |
| 48 |
msg: "bye!" |
| 49 |
} |
| 50 |
ok |
| 51 |
|
| 52 |
####################################################################### |
| 53 |
# Plain auth work as expected, anyway it doesnt fill the cache |
| 54 |
-- Expecting success with parameters: REQUIRED plain xuser_native native |
| 55 |
-- |
| 56 |
connecting... |
| 57 |
active session is now 'sess0' |
| 58 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 59 |
user plugin |
| 60 |
xuser_native mysql_native_password |
| 61 |
0 rows affected |
| 62 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 63 |
Variable_name Value |
| 64 |
Mysqlx_ssl_active ON |
| 65 |
0 rows affected |
| 66 |
closing session sess0 |
| 67 |
Mysqlx.Ok { |
| 68 |
msg: "bye!" |
| 69 |
} |
| 70 |
switched to session default |
| 71 |
-- Expecting success with parameters: REQUIRED plain xuser_sha256 sha256 |
| 72 |
-- |
| 73 |
connecting... |
| 74 |
active session is now 'sess0' |
| 75 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 76 |
user plugin |
| 77 |
xuser_sha256 sha256_password |
| 78 |
0 rows affected |
| 79 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 80 |
Variable_name Value |
| 81 |
Mysqlx_ssl_active ON |
| 82 |
0 rows affected |
| 83 |
closing session sess0 |
| 84 |
Mysqlx.Ok { |
| 85 |
msg: "bye!" |
| 86 |
} |
| 87 |
switched to session default |
| 88 |
-- Expecting success with parameters: REQUIRED plain xuser_cache2 cache2 |
| 89 |
-- |
| 90 |
connecting... |
| 91 |
active session is now 'sess0' |
| 92 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 93 |
user plugin |
| 94 |
xuser_cache2 caching_sha2_password |
| 95 |
0 rows affected |
| 96 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 97 |
Variable_name Value |
| 98 |
Mysqlx_ssl_active ON |
| 99 |
0 rows affected |
| 100 |
closing session sess0 |
| 101 |
Mysqlx.Ok { |
| 102 |
msg: "bye!" |
| 103 |
} |
| 104 |
switched to session default |
| 105 |
Mysqlx.Ok { |
| 106 |
msg: "bye!" |
| 107 |
} |
| 108 |
ok |
| 109 |
|
| 110 |
####################################################################### |
| 111 |
# Recheck that the cache is empty after plain auth, the sha256_memory request must fail: |
| 112 |
-- Expecting failure with parameters: DISABLED memory xuser_native native |
| 113 |
-- |
| 114 |
connecting... |
| 115 |
Got expected error (one of: 1045 2510 ) |
| 116 |
-- Expecting failure with parameters: DISABLED memory xuser_sha256 sha256 |
| 117 |
-- |
| 118 |
connecting... |
| 119 |
Got expected error (one of: 1045 2510 ) |
| 120 |
-- Expecting failure with parameters: DISABLED memory xuser_cache2 cache2 |
| 121 |
-- |
| 122 |
connecting... |
| 123 |
Got expected error (one of: 1045 2510 ) |
| 124 |
-- Expecting failure with parameters: REQUIRED memory xuser_native native |
| 125 |
-- |
| 126 |
connecting... |
| 127 |
Got expected error (one of: 1045 2510 ) |
| 128 |
-- Expecting failure with parameters: REQUIRED memory xuser_sha256 sha256 |
| 129 |
-- |
| 130 |
connecting... |
| 131 |
Got expected error (one of: 1045 2510 ) |
| 132 |
-- Expecting failure with parameters: REQUIRED memory xuser_cache2 cache2 |
| 133 |
-- |
| 134 |
connecting... |
| 135 |
Got expected error (one of: 1045 2510 ) |
| 136 |
Mysqlx.Ok { |
| 137 |
msg: "bye!" |
| 138 |
} |
| 139 |
ok |
| 140 |
DROP USER xuser_native@'localhost'; |
| 141 |
DROP USER xuser_sha256@'localhost'; |
| 142 |
DROP USER xuser_cache2@'localhost'; |