mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix nxos_user integration test (#27619)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
20b0716948
commit
9304d6cb01
3 changed files with 44 additions and 14 deletions
|
@ -14,6 +14,7 @@
|
||||||
- feature nxapi
|
- feature nxapi
|
||||||
- nxapi http port 80
|
- nxapi http port 80
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
|
timeout: 100
|
||||||
|
|
||||||
- name: run test case
|
- name: run test case
|
||||||
include: "{{ test_case_to_run }}"
|
include: "{{ test_case_to_run }}"
|
||||||
|
@ -26,3 +27,4 @@
|
||||||
lines:
|
lines:
|
||||||
- no feature nxapi
|
- no feature nxapi
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
|
timeout: 100
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
---
|
---
|
||||||
|
- name: Remove old entries of user
|
||||||
|
nxos_user:
|
||||||
|
aggregate:
|
||||||
|
- name: ansibletest1
|
||||||
|
- name: ansibletest2
|
||||||
|
- name: ansibletest3
|
||||||
|
state: absent
|
||||||
|
provider: "{{ cli }}"
|
||||||
|
|
||||||
|
# Start tests
|
||||||
- name: Create user
|
- name: Create user
|
||||||
nxos_user:
|
nxos_user:
|
||||||
name: netend
|
name: ansibletest1
|
||||||
roles: network-operator
|
roles: network-operator
|
||||||
state: present
|
state: present
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
|
@ -10,13 +20,14 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["username netend role network-operator"]'
|
- '"username" in result.commands[0]'
|
||||||
|
- '"role network-operator" in result.commands[1]'
|
||||||
|
|
||||||
- name: Collection of users
|
- name: Collection of users
|
||||||
nxos_user:
|
nxos_user:
|
||||||
aggregate:
|
aggregate:
|
||||||
- name: test1
|
- name: ansibletest2
|
||||||
- name: test2
|
- name: ansibletest3
|
||||||
state: present
|
state: present
|
||||||
roles: network-admin
|
roles: network-admin
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
|
@ -25,15 +36,18 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["username test1 role network-admin", "username test2 role network-admin"]'
|
|
||||||
|
|
||||||
- name: tearDown
|
- name: tearDown
|
||||||
nxos_user:
|
nxos_user:
|
||||||
purge: yes
|
aggregate:
|
||||||
|
- name: ansibletest1
|
||||||
|
- name: ansibletest2
|
||||||
|
- name: ansibletest3
|
||||||
|
state: absent
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["no username netend", "no username test1", "no username test2"]'
|
- '"no username" in result.commands[0]'
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
---
|
---
|
||||||
|
- name: Remove old entries of user
|
||||||
|
nxos_user:
|
||||||
|
aggregate:
|
||||||
|
- name: ansibletest1
|
||||||
|
- name: ansibletest2
|
||||||
|
- name: ansibletest3
|
||||||
|
state: absent
|
||||||
|
provider: "{{ nxapi }}"
|
||||||
|
|
||||||
|
# Start tests
|
||||||
- name: Create user
|
- name: Create user
|
||||||
nxos_user:
|
nxos_user:
|
||||||
name: netend
|
name: ansibletest1
|
||||||
roles: network-operator
|
roles: network-operator
|
||||||
state: present
|
state: present
|
||||||
provider: "{{ nxapi }}"
|
provider: "{{ nxapi }}"
|
||||||
|
@ -10,13 +20,14 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["username netend role network-operator"]'
|
- '"username" in result.commands[0]'
|
||||||
|
- '"role network-operator" in result.commands[1]'
|
||||||
|
|
||||||
- name: Collection of users
|
- name: Collection of users
|
||||||
nxos_user:
|
nxos_user:
|
||||||
aggregate:
|
aggregate:
|
||||||
- name: test1
|
- name: ansibletest2
|
||||||
- name: test2
|
- name: ansibletest3
|
||||||
state: present
|
state: present
|
||||||
roles: network-admin
|
roles: network-admin
|
||||||
provider: "{{ nxapi }}"
|
provider: "{{ nxapi }}"
|
||||||
|
@ -25,15 +36,18 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["username test1 role network-admin", "username test2 role network-admin"]'
|
|
||||||
|
|
||||||
- name: tearDown
|
- name: tearDown
|
||||||
nxos_user:
|
nxos_user:
|
||||||
purge: yes
|
aggregate:
|
||||||
|
- name: ansibletest1
|
||||||
|
- name: ansibletest2
|
||||||
|
- name: ansibletest3
|
||||||
|
state: absent
|
||||||
provider: "{{ nxapi }}"
|
provider: "{{ nxapi }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- 'result.commands == ["no username netend", "no username test1", "no username test2"]'
|
- '"no username" in result.commands[0]'
|
||||||
|
|
Loading…
Reference in a new issue