mysql_user: fixed encrypted option for MySQL 8.0 and test coverage (#79)

* mysql_user: fixed encrypted option for MySQL 8.0 and test coverage

The purpose of this change was originally to expand test coverage to
unblock #76, but an issue was detected with the encrypted parameter on
MySQL 8.0 in the process of writing the tests. Additionally,
user_password_update_test.yml had been disabled at some point, so I
opted to replace it with two new files that will focus on the password
and plugin auth paths.

* Updated tests to cover a couple of missing branches

* Skip tests that rely on sha256_password if pymysql < 0.9

* Cover the case where pymysql isn't installed for plugin tests

* Added better plugin auth checking to tests and other minor changes

* Fixed version detection to explicitly handle MariaDB

* Removed unneeded import from previous change

* Remove whitespace that was introduced by change that was removed

* Added unit tests for missing coverage
This commit is contained in:
Steve Teahan 2021-01-14 00:27:05 -05:00 committed by GitHub
commit 06907715d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 781 additions and 200 deletions

View file

@ -233,10 +233,14 @@
- include: remove_user.yml user_name={{user_name_1}} user_password={{ user_password_1 }}
# ============================================================
# Update user password for a user.
# Assert the user password is updated and old password can no longer be used.
# Test plaintext and encrypted password scenarios.
#
#- include: user_password_update_test.yml
- include: test_user_password.yml
# ============================================================
# Test plugin authentication scenarios.
#
- include: test_user_plugin_auth.yml
# ============================================================
# Assert create user with SELECT privileges, attempt to create database and update privileges to create database