mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Deprecate tests used as filters (#32361)
* Warn on tests used as filters * Update docs, add aliases for tests that fit more gramatically with test syntax * Fix rst formatting * Add successful filter, alias of success * Remove renamed_deprecation, it was overkill * Make directory alias for is_dir * Update tests to use proper jinja test syntax * Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax * Add conversion script, porting guide updates, and changelog updates * Update newly added uses of tests as filters * No underscore variable * Convert recent tests as filter changes to win_stat * Fix some changes related to rebasing a few integration tests * Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name * Add test for tests_as_filters_warning * Update tests as filters in newly added/modified tests * Address recent changes to several integration tests * Address recent changes in cs_vpc
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
- name: check user removal result again
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_remove_result_again|changed"
|
||||
- "win_user_remove_result_again is not changed"
|
||||
- "win_user_remove_result_again.name"
|
||||
- "win_user_remove_result_again.msg"
|
||||
- "win_user_remove_result.state == 'absent'"
|
||||
@@ -45,7 +45,7 @@
|
||||
- name: check missing query result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_missing_query_result|changed"
|
||||
- "win_user_missing_query_result is not changed"
|
||||
- "win_user_missing_query_result.name"
|
||||
- "win_user_missing_query_result.msg"
|
||||
- "win_user_missing_query_result.state == 'absent'"
|
||||
@@ -57,7 +57,7 @@
|
||||
- name: check user creation result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_create_result|changed"
|
||||
- "win_user_create_result is changed"
|
||||
- "win_user_create_result.name == '{{ test_win_user_name }}'"
|
||||
- "win_user_create_result.fullname == 'Test User'"
|
||||
- "win_user_create_result.description == 'Test user account'"
|
||||
@@ -71,7 +71,7 @@
|
||||
- name: check full name and description update result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_update_result|changed"
|
||||
- "win_user_update_result is changed"
|
||||
- "win_user_update_result.fullname == 'Test Ansible User'"
|
||||
- "win_user_update_result.description == 'Test user account created by Ansible'"
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
- name: check full name and description result again
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_update_result_again|changed"
|
||||
- "win_user_update_result_again is not changed"
|
||||
- "win_user_update_result_again.fullname == 'Test Ansible User'"
|
||||
- "win_user_update_result_again.description == 'Test user account created by Ansible'"
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
- name: check no changes result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_nochange_result|changed"
|
||||
- "win_user_nochange_result is not changed"
|
||||
|
||||
- name: test again with query state
|
||||
win_user: name="{{ test_win_user_name }}" state="query"
|
||||
@@ -102,7 +102,7 @@
|
||||
- name: check query result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_query_result|changed"
|
||||
- "win_user_query_result is not changed"
|
||||
- "win_user_query_result.state == 'present'"
|
||||
- "win_user_query_result.name == '{{ test_win_user_name }}'"
|
||||
- "win_user_query_result.fullname == 'Test Ansible User'"
|
||||
@@ -118,7 +118,7 @@
|
||||
- name: check password change result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_password_result|changed"
|
||||
- "win_user_password_result is changed"
|
||||
|
||||
- name: change user password again to same value
|
||||
win_user: name="{{ test_win_user_name }}" password="{{ test_win_user_password2 }}"
|
||||
@@ -127,7 +127,7 @@
|
||||
- name: check password change result again
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_password_result_again|changed"
|
||||
- "win_user_password_result_again is not changed"
|
||||
|
||||
- name: check update_password=on_create for existing user
|
||||
win_user: name="{{ test_win_user_name }}" password="ThisP@ssW0rdShouldNotBeUsed" update_password=on_create
|
||||
@@ -136,7 +136,7 @@
|
||||
- name: check password change with on_create flag result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_nopasschange_result|changed"
|
||||
- "win_user_nopasschange_result is not changed"
|
||||
|
||||
- name: set password expired flag
|
||||
win_user: name="{{ test_win_user_name }}" password_expired=yes
|
||||
@@ -145,7 +145,7 @@
|
||||
- name: check password expired result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_password_expired_result|changed"
|
||||
- "win_user_password_expired_result is changed"
|
||||
- "win_user_password_expired_result.password_expired"
|
||||
|
||||
- name: set password when expired
|
||||
@@ -155,7 +155,7 @@
|
||||
- name: check set password on expired result
|
||||
assert:
|
||||
that:
|
||||
- win_user_can_set_password_on_expired|changed
|
||||
- win_user_can_set_password_on_expired is changed
|
||||
|
||||
- name: set password expired flag again
|
||||
win_user: name="{{ test_win_user_name }}" password_expired=yes
|
||||
@@ -164,7 +164,7 @@
|
||||
- name: check password expired result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_password_expired_result|changed"
|
||||
- "win_user_password_expired_result is changed"
|
||||
- "win_user_password_expired_result.password_expired"
|
||||
|
||||
- name: clear password expired flag
|
||||
@@ -174,7 +174,7 @@
|
||||
- name: check clear password expired result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_clear_password_expired_result|changed"
|
||||
- "win_user_clear_password_expired_result is changed"
|
||||
- "not win_user_clear_password_expired_result.password_expired"
|
||||
|
||||
- name: set password never expires flag
|
||||
@@ -184,7 +184,7 @@
|
||||
- name: check password never expires result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_password_never_expires_result|changed"
|
||||
- "win_user_password_never_expires_result is changed"
|
||||
- "win_user_password_never_expires_result.password_never_expires"
|
||||
|
||||
- name: clear password never expires flag
|
||||
@@ -194,7 +194,7 @@
|
||||
- name: check clear password never expires result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_clear_password_never_expires_result|changed"
|
||||
- "win_user_clear_password_never_expires_result is changed"
|
||||
- "not win_user_clear_password_never_expires_result.password_never_expires"
|
||||
|
||||
- name: set user cannot change password flag
|
||||
@@ -204,7 +204,7 @@
|
||||
- name: check user cannot change password result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_cannot_change_password_result|changed"
|
||||
- "win_user_cannot_change_password_result is changed"
|
||||
- "win_user_cannot_change_password_result.user_cannot_change_password"
|
||||
|
||||
- name: clear user cannot change password flag
|
||||
@@ -214,7 +214,7 @@
|
||||
- name: check clear user cannot change password result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_can_change_password_result|changed"
|
||||
- "win_user_can_change_password_result is changed"
|
||||
- "not win_user_can_change_password_result.user_cannot_change_password"
|
||||
|
||||
- name: set account disabled flag
|
||||
@@ -224,7 +224,7 @@
|
||||
- name: check account disabled result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_account_disabled_result|changed"
|
||||
- "win_user_account_disabled_result is changed"
|
||||
- "win_user_account_disabled_result.account_disabled"
|
||||
|
||||
- name: set password on disabled account
|
||||
@@ -234,7 +234,7 @@
|
||||
- name: check set password on disabled result
|
||||
assert:
|
||||
that:
|
||||
- win_user_can_set_password_on_disabled|changed
|
||||
- win_user_can_set_password_on_disabled is changed
|
||||
- win_user_can_set_password_on_disabled.account_disabled
|
||||
|
||||
- name: clear account disabled flag
|
||||
@@ -244,7 +244,7 @@
|
||||
- name: check clear account disabled result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_clear_account_disabled_result|changed"
|
||||
- "win_user_clear_account_disabled_result is changed"
|
||||
- "not win_user_clear_account_disabled_result.account_disabled"
|
||||
|
||||
- name: attempt to set account locked flag
|
||||
@@ -255,8 +255,8 @@
|
||||
- name: verify that attempting to set account locked flag fails
|
||||
assert:
|
||||
that:
|
||||
- "win_user_set_account_locked_result|failed"
|
||||
- "not win_user_set_account_locked_result|changed"
|
||||
- "win_user_set_account_locked_result is failed"
|
||||
- "win_user_set_account_locked_result is not changed"
|
||||
|
||||
- name: attempt to lockout test account
|
||||
script: lockout_user.ps1 "{{ test_win_user_name }}"
|
||||
@@ -273,7 +273,7 @@
|
||||
- name: check clear account lockout result if account was locked
|
||||
assert:
|
||||
that:
|
||||
- "win_user_clear_account_locked_result|changed"
|
||||
- "win_user_clear_account_locked_result is changed"
|
||||
- "not win_user_clear_account_locked_result.account_locked"
|
||||
when: "win_user_account_locked_result.account_locked"
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
- name: check assign user to group result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_replace_groups_result|changed"
|
||||
- "win_user_replace_groups_result is changed"
|
||||
- "win_user_replace_groups_result.groups|length == 1"
|
||||
- "win_user_replace_groups_result.groups[0]['name'] == 'Users'"
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
- name: check assign user to group again result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_replace_groups_again_result|changed"
|
||||
- "win_user_replace_groups_again_result is not changed"
|
||||
|
||||
- name: add user to another group
|
||||
win_user: name="{{ test_win_user_name }}" groups="Power Users" groups_action="add"
|
||||
@@ -306,7 +306,7 @@
|
||||
- name: check add user to another group result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_add_groups_result|changed"
|
||||
- "win_user_add_groups_result is changed"
|
||||
- "win_user_add_groups_result.groups|length == 2"
|
||||
- "win_user_add_groups_result.groups[0]['name'] in ('Users', 'Power Users')"
|
||||
- "win_user_add_groups_result.groups[1]['name'] in ('Users', 'Power Users')"
|
||||
@@ -321,7 +321,7 @@
|
||||
- name: check add user to another group again result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_add_groups_again_result|changed"
|
||||
- "win_user_add_groups_again_result is not changed"
|
||||
|
||||
- name: remove user from a group
|
||||
win_user: name="{{ test_win_user_name }}" groups="Users" groups_action="remove"
|
||||
@@ -330,7 +330,7 @@
|
||||
- name: check remove user from group result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_remove_groups_result|changed"
|
||||
- "win_user_remove_groups_result is changed"
|
||||
- "win_user_remove_groups_result.groups|length == 1"
|
||||
- "win_user_remove_groups_result.groups[0]['name'] == 'Power Users'"
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
- name: check remove user from group again result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_remove_groups_again_result|changed"
|
||||
- "win_user_remove_groups_again_result is not changed"
|
||||
|
||||
- name: reassign test user to multiple groups
|
||||
win_user: name="{{ test_win_user_name }}" groups="Users, Guests" groups_action="replace"
|
||||
@@ -354,7 +354,7 @@
|
||||
- name: check reassign user groups result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_reassign_groups_result|changed"
|
||||
- "win_user_reassign_groups_result is changed"
|
||||
- "win_user_reassign_groups_result.groups|length == 2"
|
||||
- "win_user_reassign_groups_result.groups[0]['name'] in ('Users', 'Guests')"
|
||||
- "win_user_reassign_groups_result.groups[1]['name'] in ('Users', 'Guests')"
|
||||
@@ -371,7 +371,7 @@
|
||||
- name: check reassign user groups again result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_reassign_groups_again_result|changed"
|
||||
- "win_user_reassign_groups_again_result is not changed"
|
||||
|
||||
- name: remove user from all groups
|
||||
win_user: name="{{ test_win_user_name }}" groups=""
|
||||
@@ -380,7 +380,7 @@
|
||||
- name: check remove user from all groups result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_remove_all_groups_result|changed"
|
||||
- "win_user_remove_all_groups_result is changed"
|
||||
- "win_user_remove_all_groups_result.groups|length == 0"
|
||||
|
||||
- name: remove user from all groups again
|
||||
@@ -392,7 +392,7 @@
|
||||
- name: check remove user from all groups again result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_remove_all_groups_again_result|changed"
|
||||
- "win_user_remove_all_groups_again_result is not changed"
|
||||
|
||||
- name: assign user to invalid group
|
||||
win_user: name="{{ test_win_user_name }}" groups="Userz"
|
||||
@@ -402,9 +402,9 @@
|
||||
- name: check invalid group result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_invalid_group_result|failed"
|
||||
- "win_user_invalid_group_result is failed"
|
||||
- "win_user_invalid_group_result.msg"
|
||||
- win_user_invalid_group_result.msg | match("group 'Userz' not found")
|
||||
- win_user_invalid_group_result.msg is match("group 'Userz' not found")
|
||||
|
||||
- name: remove test user when finished
|
||||
win_user: name="{{ test_win_user_name }}" state="absent"
|
||||
@@ -413,7 +413,7 @@
|
||||
- name: check final user removal result
|
||||
assert:
|
||||
that:
|
||||
- "win_user_final_remove_result|changed"
|
||||
- "win_user_final_remove_result is changed"
|
||||
- "win_user_final_remove_result.name"
|
||||
- "win_user_final_remove_result.msg"
|
||||
- "win_user_final_remove_result.state == 'absent'"
|
||||
@@ -425,7 +425,7 @@
|
||||
- name: check removed query result
|
||||
assert:
|
||||
that:
|
||||
- "not win_user_removed_query_result|changed"
|
||||
- "win_user_removed_query_result is not changed"
|
||||
- "win_user_removed_query_result.name"
|
||||
- "win_user_removed_query_result.msg"
|
||||
- "win_user_removed_query_result.state == 'absent'"
|
||||
|
||||
Reference in New Issue
Block a user