Add aruba_aoscx show interface mgmt#2315
Conversation
matt852
left a comment
There was a problem hiding this comment.
Recommendation: Changes Required
Thanks @julmanglano — really clean PR and a thorough description. One thing to address before this can merge, plus a couple of optional notes:
Rename the prefix-length captures to match docs/dev/data_model.md. You called this out in the PR's "KNOWN IMPRECISION" section — agreed, and best to fix pre-merge so the keys don't have to change later as a breaking release. docs/dev/data_model.md prescribes PREFIX_LENGTH instead of PREFIX or MASK for slash-notation numbers.
In ntc_templates/templates/aruba_aoscx_show_interface_mgmt.textfsm, the Value declarations:
-Value IPV4_MASK (\S+)
+Value IPV4_PREFIX_LENGTH (\S+)-Value IPV6_PREFIX (\S+)
+Value IPV6_PREFIX_LENGTH (\S+)-Value IPV6_LINK_LOCAL_PREFIX (\S+)
+Value IPV6_LINK_LOCAL_PREFIX_LENGTH (\S+)The three matching rules in the Start state:
- ^\s*IPv4\s+address/subnet-mask\s+:\s+${IPV4_ADDRESS}/${IPV4_MASK}\s*$$
+ ^\s*IPv4\s+address/subnet-mask\s+:\s+${IPV4_ADDRESS}/${IPV4_PREFIX_LENGTH}\s*$$- ^\s*IPv6\s+address/prefix\s+:\s+${IPV6_ADDRESS}/${IPV6_PREFIX}\s*$$
+ ^\s*IPv6\s+address/prefix\s+:\s+${IPV6_ADDRESS}/${IPV6_PREFIX_LENGTH}\s*$$- ^\s*IPv6\s+link\s+local\s+address/prefix\s*:\s+${IPV6_LINK_LOCAL}/${IPV6_LINK_LOCAL_PREFIX}\s*$$
+ ^\s*IPv6\s+link\s+local\s+address/prefix\s*:\s+${IPV6_LINK_LOCAL}/${IPV6_LINK_LOCAL_PREFIX_LENGTH}\s*$$And the fixture keys. In tests/aruba_aoscx/show_interface_mgmt/show_interface_mgmt.yml:
- ipv4_mask: "26"
+ ipv4_prefix_length: "26"- ipv6_link_local_prefix: "64"
+ ipv6_link_local_prefix_length: "64"- ipv6_prefix: ""
+ ipv6_prefix_length: ""Apply the same three key renames to tests/aruba_aoscx/show_interface_mgmt/show_interface_mgmt2.yml (the ipv4_prefix_length value there will stay "").
A couple of optional follow-ups while you're in there:
-
Coverage gap. The two committed fixtures jointly leave several regex branches unexercised — populated default gateways (IPv4 and IPv6), populated
IPv6 address/prefix, populated nameservers, and either branch ofIpv6-only-preferred(the line is absent from both raw files, soIPV6_ONLY_PREFERREDis effectively dead). A third raw fixture from a fully-configured static device with gateways, a couple of nameservers, a global IPv6, and theIpv6-only-preferredline would close every gap. Alternatively, ifIpv6-only-preferreddoesn't reliably appear on AOS-CX, dropping that capture and its two regex rules is also fine. -
Tighten the prefix-length regex from
\S+to\d+while you're renaming — prefix lengths are always decimal digits and\d+documents that:-Value IPV4_PREFIX_LENGTH (\S+) +Value IPV4_PREFIX_LENGTH (\d+)
Same for
IPV6_PREFIX_LENGTHandIPV6_LINK_LOCAL_PREFIX_LENGTH.
Thanks!
…op IPV6_ONLY_PREFERRED - Rename IPV4_MASK/IPV6_PREFIX/IPV6_LINK_LOCAL_PREFIX to *_PREFIX_LENGTH per docs/dev/data_model.md. - Tighten the prefix-length regexes from \S+ to \d+ since the captured values are always decimal digits. - Drop IPV6_ONLY_PREFERRED capture and its two regex rules — the line isn't reliably emitted on AOS-CX (absent from both committed raws).
|
Thanks @matt852 — renamed On the coverage gap: dropped Parser tests + meta tests all green. |
Reduce six name server lines into three by making portions optional so the pattern matches when there's data as well as when it's blank.
|
@julmanglano For test coverage, it would be nice to have test data with name servers configured. |
ISSUE TYPE
COMPONENT
aruba_aoscx,
show interface mgmtSUMMARY
Adds a new template for the AOS-CX
show interface mgmtcommand,which reports the OOBM (out-of-band management) interface state and
addressing.
Capture groups:
ADDRESS_MODE,ADMIN_STATE,LINK_STATE,MAC_ADDRESS,IPV4_ADDRESS,IPV4_MASK,IPV4_GATEWAY,IPV6_ADDRESS,IPV6_PREFIX,IPV6_LINK_LOCAL,IPV6_LINK_LOCAL_PREFIX,IPV6_GATEWAY,PRIMARY_DNS,SECONDARY_DNS,TERTIARY_DNS,IPV6_ONLY_PREFERRED.Each address field has an empty-value fallback so that
unconfigured / DHCP-pending lines are emitted as empty strings
rather than causing a parse error.
Two fixtures cover both addressing modes:
show_interface_mgmt.{raw,yml}—staticmode with populatedIPv4 address/mask, link-local IPv6, all DNS empty.
show_interface_mgmt2.{raw,yml}—dhcpmode pre-lease, all IPv4fields empty, link-local IPv6 only.
KNOWN IMPRECISION
The
IPV4_MASKfield actually captures a prefix length (e.g.26),not a dotted-decimal mask, because that is the form AOS-CX emits.
Same applies to
IPV6_PREFIXandIPV6_LINK_LOCAL_PREFIX. Namesfollow the device's own labelling (
address/subnet-mask,address/prefix); a future rename toIPV4_PREFIX_LENGTHwould bemore accurate but breaking. Open to renaming pre-merge if reviewers
prefer.
Index entry inserted within the
aruba_aoscxblock at thelength-27 position (between
show_ntp_associationslength 29 andshow_arp_all-vrfslength 25).