[IOS-XR] Fix show vrf all detail parser - capture all interface names#911
[IOS-XR] Fix show vrf all detail parser - capture all interface names#911Kani999 wants to merge 3 commits intoCiscoTestAutomation:mainfrom
show vrf all detail parser - capture all interface names#911Conversation
This comment was marked as resolved.
This comment was marked as resolved.
63f819c to
db62997
Compare
|
Hi there! 👋 Best regards, |
db62997 to
ac9dcda
Compare
|
Hi team, This PR (#911) has been open since recently, but I'm still waiting for accept or deny decision. Any update on review? I'd appreciate your feedback! Thanks |
- Implemented a general regex pattern to capture all interface names
- Replaced the previous regex that relied on specific interface prefixes (e.g., Gi, Bun, Ten, etc.) with a more general pattern `r'^(?P<intf>[A-Za-z][-A-Za-z0-9/.:]+)$'`
- Introduced `in_interfaces_section` flag for accurate section tracking
ac9dcda to
b38f7ab
Compare
Verified: current
|
| Still missing | Description |
|---|---|
Te0/0/0/0.3 |
TenGigE short form |
Fo0/0/0/0.3 |
FortyGigE short form |
Hu0/0/0/0.3 |
HundredGigE short form |
BE2 |
Bundle-Ether short form |
Nu1 |
Null short form |
Null0 |
Null interface |
FortyGigabitEthernet0/0/0/0.2 |
FortyGigabitEthernet long form |
HundredGigabitEthernet0/0/0/0.2 |
HundredGigabitEthernet long form |
ManagementEthernet1/RP0/CPU0/0 |
ManagementEthernet long form |
POS0/0/0/0 |
Packet over SONET |
PacketOverSonet0/0/0/1 |
PacketOverSonet long form |
Why the allowlist approach keeps breaking
Every time Cisco adds a new interface type or users encounter a different abbreviation, the regex needs to be manually extended. This PR replaces it with a generic pattern ([A-Za-z][-A-Za-z0-9/.:]+) guarded by the in_interfaces_section state flag, which is future-proof.
PR checklist status
- ✅
make json— no changes needed (parser registration unchanged) - ✅ Changelog entry at
genieparser/changelog/undistributed/changelog_show_vrf_all_detail_iosxr_20241108103720.rst - ✅ All 6 tests pass on this branch (golden_output_1–5 + empty)
- ✅ Existing tests still pass (no regressions)
Description
Enhance interface parsing in 'show vrf all detail' parser
Implemented a general regex pattern to capture all interface names:
r'^(?P<intf>[A-Za-z][-A-Za-z0-9/.:]+)$'.in_interfaces_sectionflag for accurate section tracking:in_interfaces_section= False at the beginning of the parsing process.in_interfaces_section = Trueupon encountering the Interfaces: line.in_interfaces_section = FalseMotivation and Context
Replaced the previous regex that relied on specific interface prefixes (e.g., Gi, Bun, Ten, etc.) with a more general pattern
Checklist:
Closes #910