f3ddf1bc95
* Rebase * Completed integration tests * Added unit tests * Added warning detection * Updated tests * Completed tests * Linting Linting II YAML Lint Linting * Updated review changes * Updated examples, fixed reviews * Added failure condition * Resolved merge conflict
68 lines
2 KiB
YAML
68 lines
2 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_acl_interfaces overridden integration tests connection = {{ansible_connection}}"
|
|
|
|
- include_tasks: populate_config.yaml
|
|
|
|
- block:
|
|
- name: Overridden
|
|
nxos_acl_interfaces: &overridden
|
|
config:
|
|
- name: Ethernet1/3
|
|
access_groups:
|
|
- afi: ipv4
|
|
acls:
|
|
- name: ACL1v4
|
|
direction: out
|
|
|
|
- name: PortACL
|
|
port: true
|
|
direction: in
|
|
|
|
- afi: ipv6
|
|
acls:
|
|
- name: NewACLv6
|
|
direction: in
|
|
port: true
|
|
state: overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == True"
|
|
- "'interface Ethernet1/2' in result.commands"
|
|
- "'no ipv6 traffic-filter ACL1v6 in' in result.commands"
|
|
- "'interface Ethernet1/5' in result.commands"
|
|
- "'no ip access-group ACL1v4 out' in result.commands"
|
|
- "'no ip port access-group PortACL in' in result.commands"
|
|
- "'no ipv6 traffic-filter ACL1v6 in' in result.commands"
|
|
- "'interface Ethernet1/3' in result.commands"
|
|
- "'ip access-group ACL1v4 out' in result.commands"
|
|
- "'ip port access-group PortACL in' in result.commands"
|
|
- "'ipv6 port traffic-filter NewACLv6 in' in result.commands"
|
|
- "result.commands | length == 10"
|
|
|
|
- name: Gather acl_interfaces post facts
|
|
nxos_facts: &facts
|
|
gather_subset:
|
|
- "!all"
|
|
- "!min"
|
|
gather_network_resources: acl_interfaces
|
|
|
|
- name: Gather acls post facts
|
|
nxos_facts: *facts
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.acl_interfaces == result.after"
|
|
|
|
- name: Idempotence - overridden
|
|
nxos_acl_interfaces: *overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
always:
|
|
- include_tasks: remove_config.yaml
|