Fix issues with net_user tests on eos (#33691)
* Fix net_user/eos and also the horribly broken cleanup there * The rest of net_user/eos has the same problem
This commit is contained in:
parent
2d2f288e77
commit
551847beea
3 changed files with 33 additions and 14 deletions
|
@ -1,4 +1,11 @@
|
|||
---
|
||||
- name: Setup
|
||||
net_user: &clear_netop
|
||||
name: netop
|
||||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: Set user to privilege level 15
|
||||
net_user:
|
||||
name: netop
|
||||
|
@ -12,9 +19,7 @@
|
|||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username netop privilege 15"]'
|
||||
- 'result.commands == ["username netop privilege 15", "username netop nopassword"]'
|
||||
|
||||
- name: tearDown
|
||||
net_user:
|
||||
purge: yes
|
||||
provider: "{{ cli }}"
|
||||
net_user: *clear_netop
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
---
|
||||
- name: Setup
|
||||
net_user: &clear_users
|
||||
aggregate:
|
||||
- name: netop
|
||||
- name: netend
|
||||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: Set multiple users role
|
||||
net_user:
|
||||
aggregate:
|
||||
- name: netop
|
||||
- name: netend
|
||||
nopassword: yes
|
||||
role: network-operator
|
||||
state: present
|
||||
authorize: yes
|
||||
|
@ -13,10 +23,7 @@
|
|||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username netop role network-operator", "username netend role network-operator"]'
|
||||
- 'result.commands == ["username netop role network-operator", "username netop nopassword", "username netend role network-operator", "username netend nopassword"]'
|
||||
|
||||
- name: tearDown
|
||||
net_user:
|
||||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
net_user: *clear_users
|
||||
|
|
|
@ -1,20 +1,27 @@
|
|||
---
|
||||
- name: Setup
|
||||
net_user: &clear_netop
|
||||
name: netop
|
||||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: Create user
|
||||
net_user:
|
||||
name: netop
|
||||
nopassword: yes
|
||||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- 'result.commands == ["username netop"]'
|
||||
- 'result.commands == ["username netop nopassword"]'
|
||||
|
||||
- name: Purge users
|
||||
net_user:
|
||||
purge: yes
|
||||
provider: "{{ cli }}"
|
||||
- name: tearDown
|
||||
net_user: *clear_netop
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
Loading…
Reference in a new issue