ansible/test/integration/targets/nxos_acl_interfaces/tests/cli/rtt.yml
Adharsh Srivats R f3ddf1bc95
NX-OS ACL interfaces module (#67505)
* 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
2020-03-02 09:52:32 +05:30

99 lines
3.2 KiB
YAML

---
- debug:
msg: "Start nxos_acl_interfaces round trip integration tests connection = {{ansible_connection}}"
- include_tasks: populate_config.yaml
- block:
- name: RTT- Apply provided configuration
nxos_acl_interfaces:
config:
- name: Ethernet1/2
access_groups:
- afi: ipv6
acls:
- name: ACL1v6
direction: in
- name: Eth1/5
access_groups:
- afi: ipv4
acls:
- name: PortACL
direction: in
port: True
- name: ACL1v4
direction: out
- afi: ipv6
acls:
- name: ACL1v6
direction: in
state: merged
- name: Gather interfaces facts
nxos_facts:
gather_subset:
- "!all"
- "!min"
gather_network_resources:
- acl_interfaces
- name: Apply configuration to be reverted
nxos_acl_interfaces:
config:
- name: Eth1/4
access_groups:
- afi: ipv4
acls:
- name: NewACLv4
direction: out
- name: Ethernet1/3
access_groups:
- afi: ipv6
acls:
- name: NewACLv6
direction: in
port: true
state: overridden
register: result
- name: Assert that changes were applied
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/4' in result.commands"
- "'ip access-group NewACLv4 out' in result.commands"
- "'interface Ethernet1/3' in result.commands"
- "'ipv6 port traffic-filter NewACLv6 in' in result.commands"
- name: Revert back to base configuration using facts round trip
nxos_acl_interfaces:
config: "{{ ansible_facts['network_resources']['acl_interfaces'] }}"
state: overridden
register: result
- name: Assert that config was reverted
assert:
that:
- "result.changed==True"
- "'interface Ethernet1/2' in result.commands"
- "'ipv6 traffic-filter ACL1v6 in' in result.commands"
- "'interface Ethernet1/3' in result.commands"
- "'no ipv6 port traffic-filter NewACLv6 in' in result.commands"
- "'interface Ethernet1/4' in result.commands"
- "'no ip access-group NewACLv4 out' in result.commands"
- "'interface Ethernet1/5' in result.commands"
- "'ip access-group ACL1v4 out' in result.commands"
- "'ip port access-group PortACL in' in result.commands"
- "'ipv6 traffic-filter ACL1v6 in' in result.commands"
always:
- include_tasks: remove_config.yaml