mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
improved test coveraage for vyos_config (#35298)
This commit is contained in:
parent
f8a89f120f
commit
ed082af8c9
1 changed files with 26 additions and 2 deletions
|
@ -1,9 +1,33 @@
|
||||||
---
|
---
|
||||||
- debug: msg="START cli/config_check.yaml on connection={{ ansible_connection }}"
|
- debug: msg="START cli/config_check.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: setup
|
- name: setup- ensure interface is not present
|
||||||
vyos_config:
|
vyos_config:
|
||||||
lines: set interfaces loopback lo description test
|
lines: delete interfaces loopback lo
|
||||||
|
|
||||||
|
- name: setup- create interface
|
||||||
|
vyos_config:
|
||||||
|
lines:
|
||||||
|
- interfaces
|
||||||
|
- interfaces loopback lo
|
||||||
|
- interfaces loopback lo description test
|
||||||
|
register: result
|
||||||
|
|
||||||
|
# note collapsing the duplicate lines doesn't work if
|
||||||
|
# lines:
|
||||||
|
# - interfaces loopback lo description test
|
||||||
|
# - interfaces loopback lo
|
||||||
|
# - interfaces
|
||||||
|
|
||||||
|
- name: Check that multiple duplicate lines collapse into a single commands
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "{{ result.commands|length }} == 1"
|
||||||
|
|
||||||
|
- name: Check that set is correctly prepended
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "result.commands[0] == 'set interfaces loopback lo description test'"
|
||||||
|
|
||||||
- name: configure config_check config command
|
- name: configure config_check config command
|
||||||
vyos_config:
|
vyos_config:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue