diff options
-rw-r--r-- | mysql-test/suite/plugins/t/reuse_password_check.test | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/suite/plugins/t/reuse_password_check.test b/mysql-test/suite/plugins/t/reuse_password_check.test new file mode 100644 index 00000000000..b43d17d43bd --- /dev/null +++ b/mysql-test/suite/plugins/t/reuse_password_check.test @@ -0,0 +1,46 @@ +--source include/not_embedded.inc + +if (!$REUSE_PASSWORD_CHECK_SO) { + skip No REUSE_PASSWORD_CHECK plugin; +} + +install soname "reuse_password_check"; + +--echo # Default value (sould be unlimited i.e. 0) +SHOW GLOBAL VARIABLES like "reuse_password_check%"; + +--echo # insert user +grant select on *.* to user_name@localhost identified by 'test_pwd'; + +#--error ER_NOT_VALID_PASSWORD +#grant select on *.* to user_name@localhost identified by 'test_pwd'; +#show warnings; + +--error ER_CANNOT_USER +alter user user_name@localhost identified by 'test_pwd'; +show warnings; + +# Plugin does not work for it +#--error ER_NOT_VALID_PASSWORD +#SET PASSWORD FOR user_name@localhost = PASSWORD('test_pwd'); + +--echo # emulate old password + +update mysql.reuse_password_check_history set time= date_sub(now(), interval +11 day); + +set global reuse_password_check_interval= 10; + +--error ER_CANNOT_USER +alter user user_name@localhost identified by 'test_pwd'; +show warnings; + +drop user user_name@localhost; + +show create table mysql.reuse_password_check_history; +select hex(hash), time from mysql.reuse_password_check_history; +select count(*) from mysql.reuse_password_check_history; + +drop table mysql.reuse_password_check_history; + +uninstall plugin reuse_password_check; |