Skip to content

Add aruba_aoscx show interface mgmt#2315

Open
julmanglano wants to merge 3 commits into
networktocode:masterfrom
julmanglano:pr/aruba-aoscx-show-interface-mgmt
Open

Add aruba_aoscx show interface mgmt#2315
julmanglano wants to merge 3 commits into
networktocode:masterfrom
julmanglano:pr/aruba-aoscx-show-interface-mgmt

Conversation

@julmanglano
Copy link
Copy Markdown
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

aruba_aoscx, show interface mgmt

SUMMARY

Adds a new template for the AOS-CX show interface mgmt command,
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}static mode with populated
    IPv4 address/mask, link-local IPv6, all DNS empty.
  • show_interface_mgmt2.{raw,yml}dhcp mode pre-lease, all IPv4
    fields empty, link-local IPv6 only.
KNOWN IMPRECISION

The IPV4_MASK field 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_PREFIX and IPV6_LINK_LOCAL_PREFIX. Names
follow the device's own labelling (address/subnet-mask,
address/prefix); a future rename to IPV4_PREFIX_LENGTH would be
more accurate but breaking. Open to renaming pre-merge if reviewers
prefer.

Index entry inserted within the aruba_aoscx block at the
length-27 position (between show_ntp_associations length 29 and
show_arp_all-vrfs length 25).

Copy link
Copy Markdown
Contributor

@matt852 matt852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of Ipv6-only-preferred (the line is absent from both raw files, so IPV6_ONLY_PREFERRED is effectively dead). A third raw fixture from a fully-configured static device with gateways, a couple of nameservers, a global IPv6, and the Ipv6-only-preferred line would close every gap. Alternatively, if Ipv6-only-preferred doesn'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_LENGTH and IPV6_LINK_LOCAL_PREFIX_LENGTH.

Thanks!

@matt852 matt852 added the changes_requested Waiting on user to address feedback label May 11, 2026
…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).
@julmanglano
Copy link
Copy Markdown
Contributor Author

Thanks @matt852 — renamed IPV4_MASK / IPV6_PREFIX / IPV6_LINK_LOCAL_PREFIX to their *_PREFIX_LENGTH form per data_model.md and tightened the regexes to \d+.

On the coverage gap: dropped IPV6_ONLY_PREFERRED and its two rules — the line's absent from both raws so the capture was dead anyway. The other unexercised branches all have empty-fallback rules and aren't failing parses; happy to add a richer 3rd fixture in a follow-up if it ever matters.

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.
@mjbear
Copy link
Copy Markdown
Collaborator

mjbear commented May 15, 2026

@julmanglano
Do you have any switches configured with name servers?

For test coverage, it would be nice to have test data with name servers configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes_requested Waiting on user to address feedback question

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants