diff --git a/test/integration/targets/iosxr_user/tests/cli/basic.yaml b/test/integration/targets/iosxr_user/tests/cli/basic.yaml index 964518b9539..83bae0c2519 100644 --- a/test/integration/targets/iosxr_user/tests/cli/basic.yaml +++ b/test/integration/targets/iosxr_user/tests/cli/basic.yaml @@ -21,10 +21,26 @@ - '"username" in result.commands[0]' - '"secret" in result.commands[0]' -- name: Add user again (Idempotent) +- name: Create user with update_password always (not idempotent) iosxr_user: name: ansibletest1 password: test + update_password: always + state: present + provider: "{{ cli }}" + register: result + +- assert: + that: + - 'result.changed == true' + - '"username" in result.commands[0]' + - '"secret" in result.commands[0]' + +- name: Create user again with update_password on_create (idempotent) + iosxr_user: + name: ansibletest1 + password: test + update_password: on_create state: present provider: "{{ cli }}" register: result @@ -49,7 +65,7 @@ - 'result.changed == true' - 'result.commands == ["username ansibletest2 group sysadmin", "username ansibletest3 group sysadmin"]' -- name: Add collection of users again (Idempotent) +- name: Add collection of users again with update_password always (not idempotent) iosxr_user: users: - name: ansibletest2 @@ -59,6 +75,22 @@ provider: "{{ cli }}" register: result +- assert: + that: + - 'result.changed == true' + - 'result.commands == ["username ansibletest2 group sysadmin", "username ansibletest3 group sysadmin"]' + +- name: Add collection of users again with update_password on_create (idempotent) + iosxr_user: + users: + - name: ansibletest2 + - name: ansibletest3 + update_password: on_create + state: present + group: sysadmin + provider: "{{ cli }}" + register: result + - assert: that: - 'result.changed == false'