mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Add integration test for nxos_user (#25464)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
42
test/integration/targets/nxos_user/tests/cli/basic.yaml
Normal file
42
test/integration/targets/nxos_user/tests/cli/basic.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
- name: Create user
|
||||
nxos_user:
|
||||
name: netend
|
||||
roles: network-operator
|
||||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username netend role network-operator"]'
|
||||
|
||||
- name: Collection of users
|
||||
nxos_user:
|
||||
users:
|
||||
- name: test1
|
||||
- name: test2
|
||||
authorize: yes
|
||||
state: present
|
||||
roles: network-admin
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username test1 role network-admin", "username test2 role network-admin"]'
|
||||
|
||||
- name: tearDown
|
||||
nxos_user:
|
||||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["no username netend", "no username test1", "no username test2"]'
|
||||
Reference in New Issue
Block a user