mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-21 21:41:46 -07:00
review
This commit is contained in:
parent
856753215f
commit
7bbe80697c
1 changed files with 29 additions and 44 deletions
|
@ -483,25 +483,25 @@
|
||||||
- name: Plugin auth | Create user with plugin auth and salt
|
- name: Plugin auth | Create user with plugin auth and salt
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
name: '{{ test_user_name }}'
|
name: "{{ test_user_name }}"
|
||||||
host: '%'
|
host: "%"
|
||||||
plugin: caching_sha2_password
|
plugin: caching_sha2_password
|
||||||
plugin_auth_string: '{{ test_plugin_auth_string }}'
|
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||||
salt: '{{ test_salt }}'
|
salt: "{{ test_salt }}"
|
||||||
priv: '{{ test_default_priv }}'
|
priv: "{{ test_default_priv }}"
|
||||||
|
|
||||||
- name: Plugin auth | Connect with user and password
|
- 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\""
|
ansible.builtin.command: '{{ mysql_command }} -u {{ test_user_name }} -p{{ test_plugin_auth_string }} -e "SELECT 1"'
|
||||||
|
|
||||||
- name: Plugin auth | Alter user with same plugin auth and same salt
|
- name: Plugin auth | Alter user with same plugin auth and same salt
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
name: '{{ test_user_name }}'
|
name: "{{ test_user_name }}"
|
||||||
host: '%'
|
host: "%"
|
||||||
plugin: caching_sha2_password
|
plugin: caching_sha2_password
|
||||||
plugin_auth_string: '{{ test_plugin_auth_string }}'
|
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||||
salt: '{{ test_salt }}'
|
salt: "{{ test_salt }}"
|
||||||
priv: '{{ test_default_priv }}'
|
priv: "{{ test_default_priv }}"
|
||||||
register: result
|
register: result
|
||||||
failed_when: result is changed
|
failed_when: result is changed
|
||||||
|
|
||||||
|
@ -510,52 +510,37 @@
|
||||||
vars:
|
vars:
|
||||||
user_name: "{{ test_user_name }}"
|
user_name: "{{ test_user_name }}"
|
||||||
|
|
||||||
- name: Plugin auth | Create user with too short salt
|
- name: Plugin auth | Create user with too short salt (should fail)
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
name: '{{ test_user_name }}'
|
name: "{{ test_user_name }}"
|
||||||
host: '%'
|
host: "%"
|
||||||
plugin: caching_sha2_password
|
plugin: caching_sha2_password
|
||||||
plugin_auth_string: '{{ test_plugin_auth_string }}'
|
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||||
salt: '1234567890az'
|
salt: "1234567890az"
|
||||||
priv: '{{ test_default_priv }}'
|
priv: "{{ test_default_priv }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
failed_when: result is success
|
||||||
|
|
||||||
- name: Plugin auth | Assert that shorter salt fails
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- result is failed
|
|
||||||
|
|
||||||
- name: Plugin auth | Create user with salt and no plugin auth string (should fail)
|
- name: Plugin auth | Create user with salt and no plugin auth string (should fail)
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
name: '{{ test_user_name }}'
|
name: "{{ test_user_name }}"
|
||||||
host: '%'
|
host: "%"
|
||||||
plugin: caching_sha2_password
|
plugin: caching_sha2_password
|
||||||
salt: '{{ test_salt }}'
|
salt: "{{ test_salt }}"
|
||||||
priv: '{{ test_default_priv }}'
|
priv: "{{ test_default_priv }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
failed_when: result is success
|
||||||
|
|
||||||
- name: Plugin auth | Assert that missing plugin_auth_string with salt fails
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- result is failed
|
|
||||||
|
|
||||||
- name: Plugin auth | Create user with salt and plugin not handled by internal hash generation (should fail)
|
- name: Plugin auth | Create user with salt and plugin not handled by internal hash generation (should fail)
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
name: '{{ test_user_name }}'
|
name: "{{ test_user_name }}"
|
||||||
host: '%'
|
host: "%"
|
||||||
plugin: mysql_native_password
|
plugin: mysql_native_password
|
||||||
plugin_auth_string: '{{ test_plugin_auth_string }}'
|
plugin_auth_string: "{{ test_plugin_auth_string }}"
|
||||||
salt: '{{ test_salt }}'
|
salt: "{{ test_salt }}"
|
||||||
priv: '{{ test_default_priv }}'
|
priv: "{{ test_default_priv }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
failed_when: result is success
|
||||||
|
|
||||||
- name: Plugin auth | Assert that wrong plugin with salt fails
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- result is failed
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue