Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static_routes - Ensure idempotency with encapsulated interfaces (e.g TenGigE0/0/0/23.1234) #507

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/static_route_encap_intf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Fixes idempotency for static routes with encap interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def parse_faddr(self, item):

def parse_intf(self, item):
inf_search_strs = [
r" ((\w+)((?:\d)/(?:\d)/(?:\d)/(?:\d+))\.(?:\d+))",
r" ((\w+)((?:\d)/(?:\d)/(?:\d)/(?:\d+)))",
r" (([a-zA-Z]+)(?:\d+))",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ router static
192.0.2.16/28 FastEthernet0/0/0/1 192.0.2.10 tag 10 description LAB metric 120
192.0.2.16/28 FastEthernet0/0/0/5 track ip_sla_1
192.0.2.32/28 192.0.2.11 100
192.0.2.48/28 TenGigE0/0/0/23.2500 192.0.2.10
!
address-family ipv6 unicast
2001:db8:1000::/36 FastEthernet0/0/0/7 description DC
Expand Down
29 changes: 29 additions & 0 deletions tests/unit/modules/network/iosxr/test_iosxr_static_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,35 @@ def test_iosxr_static_routes_replaced_idempotent(self):
)
self.execute_module(changed=False, commands=[])

def test_iosxr_static_routes_replaced_idempotent_encap_intf(self):
set_module_args(
dict(
config=[
dict(
address_families=[
dict(
afi="ipv4",
safi="unicast",
routes=[
dict(
dest="192.0.2.48/28",
next_hops=[
dict(
interface="TenGigE0/0/0/23.2500",
forward_router_address="192.0.2.10",
),
],
),
],
),
],
),
],
state="replaced",
),
)
self.execute_module(changed=False, commands=[])

def test_iosxr_static_routes_overridden(self):
set_module_args(
dict(
Expand Down
Loading