add win_user regression tests

Ensure https://github.com/ansible/ansible-modules-core/issues/4369 doesn't occur again, also adds tests for password set when expired.

(cherry picked from commit 69880f1640)
pull/17680/head
nitzmahone 8 years ago
parent a900a0b4e3
commit 2e06f0b427

@ -148,6 +148,25 @@
- "win_user_password_expired_result|changed" - "win_user_password_expired_result|changed"
- "win_user_password_expired_result.password_expired" - "win_user_password_expired_result.password_expired"
- name: set password when expired
win_user: name="{{ test_win_user_name }}" password={{ test_win_user_password2 }} update_password=always
register: win_user_can_set_password_on_expired
- name: check set password on expired result
assert:
that:
- win_user_can_set_password_on_expired|changed
- name: set password expired flag again
win_user: name="{{ test_win_user_name }}" password_expired=yes
register: win_user_password_expired_result
- name: check password expired result
assert:
that:
- "win_user_password_expired_result|changed"
- "win_user_password_expired_result.password_expired"
- name: clear password expired flag - name: clear password expired flag
win_user: name="{{ test_win_user_name }}" password_expired=no win_user: name="{{ test_win_user_name }}" password_expired=no
register: win_user_clear_password_expired_result register: win_user_clear_password_expired_result
@ -208,6 +227,16 @@
- "win_user_account_disabled_result|changed" - "win_user_account_disabled_result|changed"
- "win_user_account_disabled_result.account_disabled" - "win_user_account_disabled_result.account_disabled"
- name: set password on disabled account
win_user: name="{{ test_win_user_name }}" password={{ test_win_user_password2 }} update_password=always
register: win_user_can_set_password_on_disabled
- name: check set password on disabled result
assert:
that:
- win_user_can_set_password_on_disabled|changed
- win_user_can_set_password_on_disabled.account_disabled
- name: clear account disabled flag - name: clear account disabled flag
win_user: name="{{ test_win_user_name }}" account_disabled=false win_user: name="{{ test_win_user_name }}" account_disabled=false
register: win_user_clear_account_disabled_result register: win_user_clear_account_disabled_result

Loading…
Cancel
Save