From a9b97b4681672566027b96c6e0fa4d491362148e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Sanju=C3=A1n?= Date: Wed, 28 Aug 2024 17:50:53 +0200 Subject: [PATCH] Add more tests --- .../tasks/test_user_plugin_auth.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml b/tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml index a7d77c5..df62223 100644 --- a/tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml +++ b/tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml @@ -581,6 +581,7 @@ - name: Plugin auth | Connect with user and password ansible.builtin.command: '{{ mysql_command }} -u {{ test_user_name }} -p{{ test_plugin_auth_string }} -e "SELECT 1"' + changed_when: false - name: Plugin auth | Change auth user plugin in check mode community.mysql.mysql_user: @@ -636,3 +637,25 @@ vars: user_name: "{{ test_user_name }}" plugin_type: caching_sha2_password + + - name: Plugin auth | Change user password + community.mysql.mysql_user: + <<: *mysql_params + name: "{{ test_user_name }}" + host: '%' + plugin: caching_sha2_password + plugin_auth_string: newpass + salt: "{{ test_salt }}" + priv: "{{ test_default_priv }}" + register: result + failed_when: result is not changed + + - name: Plugin auth | Connect with user and password + ansible.builtin.command: '{{ mysql_command }} -u {{ test_user_name }} -pnewpass -e "SELECT 1"' + changed_when: false + + - name: Plugin auth | Check that the expected plugin type is set after change + ansible.builtin.include_tasks: utils/assert_plugin.yml + vars: + user_name: "{{ test_user_name }}" + plugin_type: caching_sha2_password