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

cisco_xr_show_ip_route: Add edge cases #1658

Merged
merged 1 commit into from
Mar 18, 2024
Merged
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
14 changes: 14 additions & 0 deletions ntc_templates/templates/cisco_xr_show_ip_route.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,18 @@ Start
^\s*$$
^\S+\s+\S+\s+\d+\s+\d+:\d+:\d+
^% No matching routes found
^% Network not in table
^\s*Routing\s+entry\s+for\s+${NETWORK}/${PREFIX_LENGTH} -> ROUTE_ENTRY
^\s+Route\s+metric\s+is\s+\d+
^\s+\S+,\s+from\s+\S+,\s+via\s+\S+
^\s+No\s+advertising\s+protos
^. -> Error "LINE NOT FOUND"

ROUTE_ENTRY
^\s+Known\s+via\s+\"${PROTOCOL}\",\s+distance\s+${DISTANCE},\s+metric\s+${METRIC},\s+candidate\s+default\s+path
^\s+Tag\s+\d+,\s+type\s+extern\s+\d+
^\s+Installed\s\S+\s+\S+\s+\S+\s+for\s+${UPTIME}
^\s+Routing\s+Descriptor\s+Blocks
^\s+${NEXT_HOP},\s+from\s+\S+,\s+${TYPE}\s+${INTERFACE} -> Record Start
^\s+${NEXT_HOP}$$ -> Record Start
^. -> Error ROUTE_ENTRY
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Tue Jan 16 16:38:44.238 AEST

Routing entry for 0.0.0.0/0
Known via "ospf UNDERLAY", distance 110, metric 22, candidate default path
Tag 1020, type extern 1
Installed Jan 8 02:26:04.305 for 1w1d
Routing Descriptor Blocks
172.16.16.73, from 172.16.0.53, via HundredGigE0/0/0/30
Route metric is 22
172.16.16.75, from 172.16.0.53, via HundredGigE0/0/0/31
Route metric is 22
No advertising protos.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
parsed_sample:
- distance: "110"
interface: "HundredGigE0/0/0/30"
metric: "22"
network: "0.0.0.0"
next_hop: "172.16.16.73"
prefix_length: "0"
protocol: "ospf UNDERLAY"
type: "via"
uptime: "1w1d"
vrf: ""
17 changes: 17 additions & 0 deletions tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf_all.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Tue Jan 16 16:57:28.146 AEST

VRF: management


Routing entry for 0.0.0.0/0
Known via "static", distance 1, metric 0, candidate default path
Installed Jan 7 19:42:10.791 for 1w1d
Routing Descriptor Blocks
172.1.1.1
Route metric is 0
No advertising protos.

VRF: **iid


% Network not in table
12 changes: 12 additions & 0 deletions tests/cisco_xr/show_ip_route/cisco_xr_show_ip_route_vrf_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
parsed_sample:
- distance: "1"
interface: ""
metric: "0"
network: "0.0.0.0"
next_hop: "172.1.1.1"
prefix_length: "0"
protocol: "static"
type: ""
uptime: "1w1d"
vrf: "management"
Loading