mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add unit test for mysql_user (#17335)
this removes all blank users, and then does so again to ensure changed the first time and ok the second time
This commit is contained in:
parent
3a83379b1d
commit
2248d2464b
1 changed files with 18 additions and 0 deletions
|
@ -23,3 +23,21 @@
|
||||||
|
|
||||||
- name: assert output message mysql user was removed
|
- name: assert output message mysql user was removed
|
||||||
assert: { that: "result.changed == true" }
|
assert: { that: "result.changed == true" }
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
- name: create blank mysql user to be removed later
|
||||||
|
mysql_user: name="" state=present
|
||||||
|
|
||||||
|
- name: remove blank mysql user with hosts=all (expect changed)
|
||||||
|
mysql_user: user="" host_all=true state=absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert changed is true for removing all blank users
|
||||||
|
assert: { that: "result.changed == true" }
|
||||||
|
|
||||||
|
- name: remove blank mysql user with hosts=all (expect ok)
|
||||||
|
mysql_user: user="" host_all=true state=absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert changed is true for removing all blank users
|
||||||
|
assert: { that: "result.changed == false" }
|
||||||
|
|
Loading…
Reference in a new issue