Skip to content

Commit

Permalink
correct ci test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 committed Oct 22, 2024
1 parent 2da3395 commit 721397d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- block:
- name: Merge the provided configuration with the existing running configuration
register: result
cisco.iosxr.iosxr_static_routes: &id001
cisco.iosxr.iosxr_static_routes:
config:
- address_families:
- afi: ipv4
Expand Down Expand Up @@ -92,19 +92,10 @@
that:
- "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}"

- name: Merge the provided configuration with the existing running configuration (idempotent)
register: result
cisco.iosxr.iosxr_static_routes: *id001
- name: Assert that the previous task was idempotent
ansible.builtin.assert:
that:
- result['changed'] == false
- result.commands|length == 0

- name: Assert that before dicts were correctly generated
ansible.builtin.assert:
that:
- "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}"
- "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}"

- name: Update existing configuration using merged
register: result
Expand Down
28 changes: 24 additions & 4 deletions tests/integration/targets/iosxr_static_routes/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ merged:
- vrf DEV_SITE
- address-family ipv4 unicast
- 192.0.2.48/28 vrf test_1 192.0.2.12 description DEV
- 192.0.2.80/28 vrf test_1 192.0.2.14 FastEthernet0/0/0/2 track ip_sla_2 vrflabel
124
- 192.0.2.80/28 vrf test_1 192.0.2.14 FastEthernet0/0/0/2 track ip_sla_2 vrflabel 124
- vrf TEST_VRF
- address-family ipv4 unicast
- 192.1.0.0/24 Loopback1
- 192.1.0.0/24 vrf Loopback1
update_commands:
- router static
- vrf DEV_SITE
Expand Down Expand Up @@ -97,11 +96,17 @@ merged:
- dest: 192.1.0.0/24
next_hops:
- dest_vrf: Loopback1
- interface: Loopback1
interface: Loopback1
safi: unicast
vrf: TEST_VRF
update_after:
- address_families:
- afi: ipv4
routes:
- dest: 0.0.0.0/0
next_hops:
- forward_router_address: 10.0.151.254
safi: unicast
- afi: ipv4
routes:
- dest: 192.0.2.16/28
Expand All @@ -117,6 +122,9 @@ merged:
next_hops:
- admin_distance: 100
forward_router_address: 192.0.2.11
- dest: 192.168.17.0/24
next_hops:
- interface: Loopback0
safi: multicast
- afi: ipv6
routes:
Expand All @@ -126,6 +134,9 @@ merged:
interface: FastEthernet0/0/0/7
- forward_router_address: 2001:db8:2000:2::1
interface: FastEthernet0/0/0/8
- dest: 2001:db8::/64
next_hops:
- interface: Loopback0
safi: unicast
- address_families:
- afi: ipv4
Expand All @@ -146,6 +157,15 @@ merged:
description: rt_test_1
safi: unicast
vrf: DEV_SITE
- address_families:
- afi: ipv4
routes:
- dest: 192.1.0.0/24
next_hops:
- dest_vrf: Loopback1
interface: Loopback1
safi: unicast
vrf: TEST_VRF
replaced:
before:
- address_families:
Expand Down
5 changes: 1 addition & 4 deletions tests/unit/modules/network/iosxr/test_iosxr_static_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,8 @@ def test_iosxr_static_routes_overridden(self):
)
commands = [
"router static",
"no address-family ipv4 unicast",
"no address-family ipv6 unicast",
"no address-family ipv4 multicast",
"no vrf DEV_SITE",
"no vrf TEST_VRF",
"no vrf DEV_SITE",
"vrf DEV_SITE_NEW",
"address-family ipv4 unicast",
"192.0.4.16/28 192.0.2.10 FastEthernet0/0/0/1 description LAB metric 120 tag 10",
Expand Down

0 comments on commit 721397d

Please sign in to comment.