| 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 after altering an account |
| 13 |
## |
| 14 |
## when: |
| 15 |
## * plain auth is going to fill the cache |
| 16 |
## * next test is going that ALTER USER, RENAME USER, DROP USER |
| 17 |
## clears the case |
| 18 |
## |
| 19 |
## Requirements: CI1, CI3, CI4, CI5 |
| 20 |
# |
| 21 |
|
| 22 |
####################################################################### |
| 23 |
## Fill cache with all xuser_* accounts |
| 24 |
# |
| 25 |
-- Expecting success with parameters: REQUIRED plain xuser_native native |
| 26 |
-- |
| 27 |
connecting... |
| 28 |
active session is now 'sess0' |
| 29 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 30 |
user plugin |
| 31 |
xuser_native mysql_native_password |
| 32 |
0 rows affected |
| 33 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 34 |
Variable_name Value |
| 35 |
Mysqlx_ssl_active ON |
| 36 |
0 rows affected |
| 37 |
closing session sess0 |
| 38 |
Mysqlx.Ok { |
| 39 |
msg: "bye!" |
| 40 |
} |
| 41 |
switched to session default |
| 42 |
-- Expecting success with parameters: REQUIRED plain xuser_sha256 sha256 |
| 43 |
-- |
| 44 |
connecting... |
| 45 |
active session is now 'sess0' |
| 46 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 47 |
user plugin |
| 48 |
xuser_sha256 sha256_password |
| 49 |
0 rows affected |
| 50 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 51 |
Variable_name Value |
| 52 |
Mysqlx_ssl_active ON |
| 53 |
0 rows affected |
| 54 |
closing session sess0 |
| 55 |
Mysqlx.Ok { |
| 56 |
msg: "bye!" |
| 57 |
} |
| 58 |
switched to session default |
| 59 |
-- Expecting success with parameters: REQUIRED plain xuser_cache2 cache2 |
| 60 |
-- |
| 61 |
connecting... |
| 62 |
active session is now 'sess0' |
| 63 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 64 |
user plugin |
| 65 |
xuser_cache2 caching_sha2_password |
| 66 |
0 rows affected |
| 67 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 68 |
Variable_name Value |
| 69 |
Mysqlx_ssl_active ON |
| 70 |
0 rows affected |
| 71 |
closing session sess0 |
| 72 |
Mysqlx.Ok { |
| 73 |
msg: "bye!" |
| 74 |
} |
| 75 |
switched to session default |
| 76 |
|
| 77 |
####################################################################### |
| 78 |
## Check if the account entries are removed after changing the account. |
| 79 |
# |
| 80 |
-- Expecting success with parameters: DISABLED memory xuser_native native |
| 81 |
-- |
| 82 |
connecting... |
| 83 |
active session is now 'sess0' |
| 84 |
closing session sess0 |
| 85 |
Mysqlx.Ok { |
| 86 |
msg: "bye!" |
| 87 |
} |
| 88 |
switched to session default |
| 89 |
RUN ALTER USER xuser_native@localhost IDENTIFIED BY 'native2'; |
| 90 |
|
| 91 |
0 rows affected |
| 92 |
-- Expecting failure with parameters: DISABLED memory xuser_native native |
| 93 |
-- |
| 94 |
connecting... |
| 95 |
Got expected error (one of: 1045 2510 ) |
| 96 |
-- Expecting failure with parameters: DISABLED memory xuser_native native2 |
| 97 |
-- |
| 98 |
connecting... |
| 99 |
Got expected error (one of: 1045 2510 ) |
| 100 |
-- Expecting success with parameters: DISABLED memory xuser_sha256 sha256 |
| 101 |
-- |
| 102 |
connecting... |
| 103 |
active session is now 'sess0' |
| 104 |
closing session sess0 |
| 105 |
Mysqlx.Ok { |
| 106 |
msg: "bye!" |
| 107 |
} |
| 108 |
switched to session default |
| 109 |
RUN RENAME USER xuser_sha256@localhost TO xuser_sha2@localhost; |
| 110 |
|
| 111 |
0 rows affected |
| 112 |
-- Expecting failure with parameters: DISABLED memory xuser_sha2 sha256 |
| 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 success with parameters: DISABLED memory xuser_cache2 cache2 |
| 121 |
-- |
| 122 |
connecting... |
| 123 |
active session is now 'sess0' |
| 124 |
closing session sess0 |
| 125 |
Mysqlx.Ok { |
| 126 |
msg: "bye!" |
| 127 |
} |
| 128 |
switched to session default |
| 129 |
RUN DROP USER xuser_cache2@localhost; |
| 130 |
|
| 131 |
0 rows affected |
| 132 |
-- Expecting failure with parameters: DISABLED memory xuser_cache2 cache2 |
| 133 |
-- |
| 134 |
connecting... |
| 135 |
Got expected error (one of: 1045 2510 ) |
| 136 |
|
| 137 |
####################################################################### |
| 138 |
## Go back to orginal settings |
| 139 |
# |
| 140 |
RUN ALTER USER xuser_native@localhost IDENTIFIED BY 'native' |
| 141 |
|
| 142 |
0 rows affected |
| 143 |
RUN RENAME USER xuser_sha2@localhost TO xuser_sha256@localhost |
| 144 |
|
| 145 |
0 rows affected |
| 146 |
RUN CREATE USER xuser_cache2@localhost IDENTIFIED WITH 'caching_sha2_password' BY 'cache2' |
| 147 |
|
| 148 |
0 rows affected |
| 149 |
RUN GRANT ALL ON *.* TO xuser_cache2@localhost |
| 150 |
|
| 151 |
0 rows affected |
| 152 |
|
| 153 |
####################################################################### |
| 154 |
## Fill cache again |
| 155 |
# |
| 156 |
-- Expecting success with parameters: REQUIRED plain xuser_native native |
| 157 |
-- |
| 158 |
connecting... |
| 159 |
active session is now 'sess0' |
| 160 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 161 |
user plugin |
| 162 |
xuser_native mysql_native_password |
| 163 |
0 rows affected |
| 164 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 165 |
Variable_name Value |
| 166 |
Mysqlx_ssl_active ON |
| 167 |
0 rows affected |
| 168 |
closing session sess0 |
| 169 |
Mysqlx.Ok { |
| 170 |
msg: "bye!" |
| 171 |
} |
| 172 |
switched to session default |
| 173 |
-- Expecting success with parameters: REQUIRED plain xuser_sha256 sha256 |
| 174 |
-- |
| 175 |
connecting... |
| 176 |
active session is now 'sess0' |
| 177 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 178 |
user plugin |
| 179 |
xuser_sha256 sha256_password |
| 180 |
0 rows affected |
| 181 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 182 |
Variable_name Value |
| 183 |
Mysqlx_ssl_active ON |
| 184 |
0 rows affected |
| 185 |
closing session sess0 |
| 186 |
Mysqlx.Ok { |
| 187 |
msg: "bye!" |
| 188 |
} |
| 189 |
switched to session default |
| 190 |
-- Expecting success with parameters: REQUIRED plain xuser_cache2 cache2 |
| 191 |
-- |
| 192 |
connecting... |
| 193 |
active session is now 'sess0' |
| 194 |
RUN SELECT user, plugin FROM mysql.user WHERE user = REPLACE(USER(), '@localhost', '') |
| 195 |
user plugin |
| 196 |
xuser_cache2 caching_sha2_password |
| 197 |
0 rows affected |
| 198 |
RUN SHOW STATUS LIKE 'Mysqlx_ssl_active' |
| 199 |
Variable_name Value |
| 200 |
Mysqlx_ssl_active ON |
| 201 |
0 rows affected |
| 202 |
closing session sess0 |
| 203 |
Mysqlx.Ok { |
| 204 |
msg: "bye!" |
| 205 |
} |
| 206 |
switched to session default |
| 207 |
-- Expecting success with parameters: DISABLED memory xuser_native native |
| 208 |
-- |
| 209 |
connecting... |
| 210 |
active session is now 'sess0' |
| 211 |
closing session sess0 |
| 212 |
Mysqlx.Ok { |
| 213 |
msg: "bye!" |
| 214 |
} |
| 215 |
switched to session default |
| 216 |
RUN SET PASSWORD FOR 'xuser_native'@'localhost' = 'native3'; |
| 217 |
|
| 218 |
0 rows affected |
| 219 |
-- Expecting failure with parameters: DISABLED memory xuser_native native3 |
| 220 |
-- |
| 221 |
connecting... |
| 222 |
Got expected error (one of: 1045 2510 ) |
| 223 |
-- Expecting failure with parameters: DISABLED memory xuser_native native |
| 224 |
-- |
| 225 |
connecting... |
| 226 |
Got expected error (one of: 1045 2510 ) |
| 227 |
-- Expecting success with parameters: DISABLED memory xuser_sha256 sha256 |
| 228 |
-- |
| 229 |
connecting... |
| 230 |
active session is now 'sess0' |
| 231 |
closing session sess0 |
| 232 |
Mysqlx.Ok { |
| 233 |
msg: "bye!" |
| 234 |
} |
| 235 |
switched to session default |
| 236 |
RUN GRANT SELECT,LOCK TABLES ON *.* TO xuser_sha256@'localhost' |
| 237 |
|
| 238 |
0 rows affected |
| 239 |
RUN SET PASSWORD FOR 'xuser_sha256'@'localhost' = 'sha256_new' |
| 240 |
|
| 241 |
0 rows affected |
| 242 |
-- Expecting failure with parameters: DISABLED memory xuser_sha256 sha256 |
| 243 |
-- |
| 244 |
connecting... |
| 245 |
Got expected error (one of: 1045 2510 ) |
| 246 |
-- Expecting failure with parameters: DISABLED memory xuser_sha256 sha256_new |
| 247 |
-- |
| 248 |
connecting... |
| 249 |
Got expected error (one of: 1045 2510 ) |
| 250 |
Mysqlx.Ok { |
| 251 |
msg: "bye!" |
| 252 |
} |
| 253 |
ok |
| 254 |
DROP USER xuser_native@'localhost'; |
| 255 |
DROP USER xuser_sha256@'localhost'; |
| 256 |
DROP USER xuser_cache2@'localhost'; |