mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-25 07:21:45 -07:00
Refactor tests to use is succeeded or is failed
This commit is contained in:
parent
e3a2b22fdd
commit
d93b27e120
6 changed files with 24 additions and 24 deletions
|
@ -398,7 +398,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.failed == true
|
||||
- result is failed
|
||||
|
||||
- name: try to import with force parameter
|
||||
mysql_db:
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
- name: assert test mysql_db encoding param not valid - issue 8075 (failed=true)
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
- "'Traceback' not in result.msg"
|
||||
- "'Unknown character set' in result.msg"
|
||||
|
||||
|
@ -233,7 +233,7 @@
|
|||
- name: assert output message that database was not created using dbuser2
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
- "'Access denied' in result.msg"
|
||||
|
||||
- name: run command to test that database was not created
|
||||
|
@ -260,7 +260,7 @@
|
|||
- name: assert output message that database was not deleted using dbuser2
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
- "'Access denied' in result.msg"
|
||||
|
||||
- name: run command to test database was not deleted
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.failed == true
|
||||
- result is failed
|
||||
|
||||
- name: Check the prev rename
|
||||
mysql_query:
|
||||
|
@ -271,8 +271,8 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('the query option value must be a string or list')
|
||||
- result is failed
|
||||
- result.msg is search('the query option value must be a string or list')
|
||||
|
||||
- name: Pass wrong query element
|
||||
mysql_query:
|
||||
|
@ -286,8 +286,8 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
- result.msg is search('the elements in query list must be strings')
|
||||
- result is failed
|
||||
- result.msg is search('the elements in query list must be strings')
|
||||
|
||||
- name: Create {{ test_table4 }}
|
||||
mysql_query:
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Run mysql_user again without any changes
|
||||
mysql_user:
|
||||
|
@ -95,7 +95,7 @@
|
|||
- name: Assert that the mysql_info module failed because we used the old password
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
|
||||
- name: Get the MySQL version data using the new password (should work)
|
||||
mysql_info:
|
||||
|
@ -110,7 +110,7 @@
|
|||
- name: Assert that the mysql_info module succeeded because we used the new password
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
# Cleanup
|
||||
- include: remove_user.yml user_name={{ test_user_name }} user_password={{ new_password }}
|
||||
|
@ -187,7 +187,7 @@
|
|||
- name: Assert that the mysql_info module succeeded because we used the new password
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Pass in the same password as before, but in the encrypted form (no change expected)
|
||||
mysql_user:
|
||||
|
@ -235,7 +235,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Get the MySQL version using an non-empty password (should fail)
|
||||
mysql_info:
|
||||
|
@ -250,7 +250,7 @@
|
|||
- name: Assert that mysql_info failed
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
|
||||
- name: Update the user without changing the password
|
||||
mysql_user:
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Update the user with a different hash
|
||||
mysql_user:
|
||||
|
@ -88,7 +88,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
# Cleanup
|
||||
- include: remove_user.yml user_name={{ test_user_name }} user_password={{ test_plugin_new_auth_string }}
|
||||
|
@ -135,7 +135,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Update the user with the same hash (no change expected)
|
||||
mysql_user:
|
||||
|
@ -180,7 +180,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
# Cleanup
|
||||
- include: remove_user.yml user_name={{ test_user_name }} user_password={{ test_plugin_auth_string }}
|
||||
|
@ -227,7 +227,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Update the user with the same auth string
|
||||
mysql_user:
|
||||
|
@ -271,7 +271,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
# Cleanup
|
||||
- include: remove_user.yml user_name={{ test_user_name }} user_password={{ test_plugin_auth_string }}
|
||||
|
@ -318,7 +318,7 @@
|
|||
- name: Assert that mysql_info was successful
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
- result is succeeded
|
||||
|
||||
- name: Get the MySQL version using an non-empty password (should fail)
|
||||
mysql_info:
|
||||
|
@ -333,7 +333,7 @@
|
|||
- name: Assert that mysql_info failed
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result is failed
|
||||
|
||||
- name: Update the user without changing the auth mechanism
|
||||
mysql_user:
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
- name: assert message failure (expect failed=true)
|
||||
assert:
|
||||
that:
|
||||
- "output.failed | bool == true"
|
||||
- output is failed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue