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:
Jonathan Mainguy 2016-08-31 16:02:31 -04:00 committed by Michael Scherer
parent 3a83379b1d
commit 2248d2464b

View file

@ -23,3 +23,21 @@
- name: assert output message mysql user was removed
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" }