ansible/test/integration/targets/eos_static_routes/tests/cli/deleted.yaml
GomathiselviS 726d6455d8
eos static_routes module added (#65480)
* Adding files for RM static_routes

* Added Integration tests

* Added Unit testcases

* Addressed review comments

* corrected lint errors

* corrected documentation errors

* Lint errors

* corrected test/sanity

* corrected documentation for deprecation

* corrected case sensitivity

* Again Documentation eroor

* Lint errors again

* corrected deprecated module in ignoretxt

* added new gethered,rendered,parsed state checks to unit test

* New code broke the old flow-fixed

* Lint errs

* Added check for running_config

* Add rtt testcase

* Fixed unit tcs

* lint errors

* lint errors

* Modified replaced operation behavior

* updated documentation and tests for delete opration

* fixed shippable errors

* review comments and flake8 error fix

* syntax errors fixed
2020-02-25 07:50:27 -05:00

224 lines
5.6 KiB
YAML

---
- debug:
msg: "Start eos_static_routes deleted integration tests ansible_connection={{ ansible_connection }}"
- include_tasks: _populate.yaml
- set_fact:
config:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- interface: Management1
- admin_distance: 200
forward_router_address: 20.1.1.3
interface: Ethernet1
track: bfd
- dest: 10.50.0.0/16
next_hops:
- interface: Management1
- dest: 23.1.0.0/16
next_hops:
- nexthop_grp: testgrp
tag: 42
- address_families:
- afi: ipv4
routes:
- dest: 77.77.1.0/24
next_hops:
- interface: 33.1.1.1
vrf: vrftest1
- set_fact:
config1:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- interface: Management1
- admin_distance: 200
forward_router_address: 20.1.1.3
interface: Ethernet1
track: bfd
- dest: 10.50.0.0/16
next_hops:
- interface: Management1
- dest: 23.1.0.0/16
next_hops:
- nexthop_grp: testgrp
tag: 42
- address_families:
- afi: ipv4
routes:
- dest: 77.77.1.0/24
next_hops:
- interface: 33.1.1.1
vrf: vrftest1
- address_families:
- afi: ipv4
routes:
- dest: 120.1.1.0/24
next_hops:
- interface: Ethernet1
admin_distance: 23
vrf: testvrf
- set_fact:
config2:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- interface: Management1
- admin_distance: 200
forward_router_address: 20.1.1.3
interface: Ethernet1
track: bfd
- dest: 10.50.0.0/16
next_hops:
- interface: Management1
- dest: 23.1.0.0/16
next_hops:
- nexthop_grp: testgrp
tag: 42
- address_families:
- afi: ipv4
routes:
- dest: 120.1.1.0/24
next_hops:
- admin_distance: 23
interface: Ethernet1
vrf: testvrf
- set_fact:
config3:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- admin_distance: 200
forward_router_address: 20.1.1.3
interface: Ethernet1
track: bfd
- dest: 10.50.0.0/16
next_hops:
- interface: Management1
- dest: 23.1.0.0/16
next_hops:
- nexthop_grp: testgrp
tag: 42
- address_families:
- afi: ipv4
routes:
- dest: 120.1.1.0/24
next_hops:
- interface: Ethernet1
admin_distance: 23
vrf: testvrf
- name: Delete attributes of given static routes - dest specific.
eos_static_routes: &deleted
config:
- vrf: "testvrf"
address_families:
- afi: 'ipv4'
routes:
- dest: '120.1.1.0/24'
- address_families:
- afi: 'ipv6'
routes:
- dest: '1000:10::/64'
state: deleted
become: yes
register: result
- eos_facts:
gather_network_resources: static_routes
become: yes
- assert:
that:
- "ansible_facts.network_resources.static_routes|symmetric_difference(config) == []"
- '"no ip route vrf testvrf 120.1.1.0/24 Ethernet1 23" in result.commands'
- '"no ipv6 route 1000:10::/64 Ethernet1 67 tag 98" in result.commands'
become: yes
- name: Idempotency check
eos_static_routes: *deleted
become: yes
register: result
- assert:
that:
- "result.changed == false"
- "result.commands|length == 0"
- include_tasks: _populate.yaml
- name: Delete attributes of given static routes - afi specific.
eos_static_routes:
config:
- address_families:
- afi: 'ipv6'
state: deleted
become: yes
register: result
- eos_facts:
gather_network_resources: static_routes
become: yes
- assert:
that:
- "ansible_facts.network_resources.static_routes|symmetric_difference(config1) == []"
- '"no ipv6 route 1000:10::/64 Ethernet1 67 tag 98" in result.commands'
become: yes
- name: Delete attributes of given static routes - vrf specific.
eos_static_routes:
config:
- vrf: vrftest1
state: deleted
become: yes
register: result
- eos_facts:
gather_network_resources: static_routes
become: yes
- assert:
that:
- "ansible_facts.network_resources.static_routes|symmetric_difference(config2) == []"
- '"no ip route vrf vrftest1 77.77.1.0/24 33.1.1.1" in result.commands'
become: yes
- name: Delete attributes of given static routes - nexthop specific.
eos_static_routes:
config:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- interface: Management1
state: deleted
become: yes
register: result
- eos_facts:
gather_network_resources: static_routes
become: yes
- assert:
that:
- "ansible_facts.network_resources.static_routes|symmetric_difference(config3) == []"
- '"no ip route 10.1.1.0/24 Management1" in result.commands'
become: yes
- include_tasks: _remove_config.yaml