ansible/test/integration/targets/vyos_firewall_interfaces/tests/cli/rendered.yaml
Rohit 8f9f8ec594
VyOS: firewall_interfaces module added (#67254)
* firewall_interfaces module added

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* sanity fixes

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* sanity fixes

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* delete opr updated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* tests updated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* comments incorporated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* ci failure fix

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
2020-03-01 11:02:22 +05:30

55 lines
1.6 KiB
YAML

---
- debug:
msg: "START vyos_firewall_interfaces rendered integration tests on connection={{ ansible_connection }}"
- block:
- name: Structure provided configuration into device specific commands
vyos_firewall_interfaces: &rendered
config:
- name: 'eth1'
access_rules:
- afi: 'ipv4'
rules:
- name: 'INBOUND'
direction: 'in'
- name: 'OUTBOUND'
direction: 'out'
- name: 'LOCAL'
direction: 'local'
- afi: 'ipv6'
rules:
- name: 'V6-LOCAL'
direction: 'local'
- name: 'eth2'
access_rules:
- afi: 'ipv4'
rules:
- name: 'INBOUND'
direction: 'in'
- name: 'OUTBOUND'
direction: 'out'
- name: 'LOCAL'
direction: 'local'
- afi: 'ipv6'
rules:
- name: 'V6-LOCAL'
direction: 'local'
state: rendered
register: result
- name: Assert that correct set of commands were generated
assert:
that:
- "{{ rendered['commands'] | symmetric_difference(result['rendered']) |length == 0 }}"
- name: Structure provided configuration into device specific commands (IDEMPOTENT)
vyos_firewall_interfaces: *rendered
register: result
- name: Assert that the previous task was idempotent
assert:
that:
- "result['changed'] == false"
always:
- include_tasks: _remove_config.yaml