| 1 |
# Following variables should be set: |
| 2 |
# $USER Name of the user |
| 3 |
# $PASSWORD Password to be supplied |
| 4 |
# $SUCCESS Whether a successful connection is expected or not |
| 5 |
# $DELAY_STATS Expected value of Connection_control_delay_generated |
| 6 |
# $USE_AUTH_PLUGIN Whether an authentication plugin is to be used or not |
| 7 |
# $CLIENT_AUTH_PLUGIN Authentication plugin |
| 8 |
|
| 9 |
connection default; |
| 10 |
disable_query_log; |
| 11 |
disable_result_log; |
| 12 |
|
| 13 |
if ($SUCCESS == 0) |
| 14 |
{ |
| 15 |
--echo # Connection attempt should fail. |
| 16 |
if ($USE_AUTH_PLUGIN == 0) |
| 17 |
{ |
| 18 |
--error 1 |
| 19 |
--exec $MYSQL -u$USER -p$PASSWORD -e "SELECT 1;" 2>&1 |
| 20 |
} |
| 21 |
if ($USE_AUTH_PLUGIN == 1) |
| 22 |
{ |
| 23 |
--error 1 |
| 24 |
--exec $MYSQL -u$USER $CLIENT_AUTH_PLUGIN -p$PASSWORD -e "SELECT 1;" 2>&1 |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
if ($SUCCESS != 0) |
| 29 |
{ |
| 30 |
--echo # Connection attempt should succeed. |
| 31 |
if ($USE_AUTH_PLUGIN == 0) |
| 32 |
{ |
| 33 |
--exec $MYSQL -u$USER -p$PASSWORD -e "SELECT 1;" 2>&1 |
| 34 |
} |
| 35 |
if ($USE_AUTH_PLUGIN == 1) |
| 36 |
{ |
| 37 |
--exec $MYSQL -u$USER $CLIENT_AUTH_PLUGIN -p$PASSWORD -e "SELECT 1;" 2>&1 |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
enable_result_log; |
| 42 |
--echo Connection_control_delay_generated should be $DELAY_STATS |
| 43 |
SHOW STATUS LIKE 'Connection_control_delay_generated'; |
| 44 |
enable_query_log; |