ansible/test/integration/targets/nxos_acl_interfaces/tests/cli/deleted.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

90 lines
2.4 KiB
YAML

---
- debug:
msg: "Start nxos_acl_interfaces deleted integration tests connection = {{ansible_connection}}"
- include_tasks: populate_config.yaml
- block:
- name: Delete single ACL from an interface
nxos_acl_interfaces:
config:
- name: Ethernet1/5
access_groups:
- afi: ipv6
acls:
- name: ACL1v6
direction: in
state: deleted
register: result
- assert:
that:
- "result.changed == true"
- "'interface Ethernet1/5' in result.commands"
- "'no ipv6 traffic-filter ACL1v6 in' in result.commands"
- "result.commands | length ==2"
- name: Delete all ACLs of given AFI from an interface
nxos_acl_interfaces:
config:
- name: Ethernet1/5
access_groups:
- afi: ipv4
state: deleted
register: result
- assert:
that:
- "result.changed == true"
- "'interface Ethernet1/5' in result.commands"
- "'no ip port access-group PortACL in' in result.commands"
- "'no ip access-group ACL1v4 out' in result.commands"
- "result.commands | length ==3"
- name: Delete all ACLs configuration from given interface
nxos_acl_interfaces: &deleted
config:
- name: Ethernet1/2
state: deleted
register: result
- assert:
that:
- "result.changed == True"
- "'interface Ethernet1/2' in result.commands"
- "'no ipv6 traffic-filter ACL1v6 in' in result.commands"
- "result.commands | length == 2"
- include_tasks: populate_config.yaml
- name: Delete all ACLs from all interfaces (from all interfaces)
nxos_acl_interfaces:
config:
state: deleted
register: result
- name: Gather acl interfaces facts
nxos_facts: &facts
gather_subset:
- "!all"
- "!min"
gather_network_resources: acl_interfaces
- assert:
that:
- "result.changed == True"
- "ansible_facts.network_resources.acl_interfaces == result.after"
- name: Gather acls facts
nxos_facts: *facts
- name: Idempotence - deleted
nxos_acl_interfaces: *deleted
register: result
- assert:
that:
- "result.changed == false"
always:
- include_tasks: remove_config.yaml