Skip to content

Commit

Permalink
Aruba aoscx show interface/vlan fixes (networktocode#1559)
Browse files Browse the repository at this point in the history
* add show_interface case
  • Loading branch information
dainok authored and mjbear committed Jan 7, 2024
1 parent 6319bee commit b877d06
Show file tree
Hide file tree
Showing 11 changed files with 804 additions and 18 deletions.
95 changes: 80 additions & 15 deletions ntc_templates/templates/aruba_aoscx_show_interface.textfsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value INTERFACE (\S+)
Value Required INTERFACE (\S+)
Value LINK_STATUS (\w+)
Value LINK_ADMIN (\w+)
Value LINK_STATE_INFO (\.*)
Expand All @@ -8,6 +8,7 @@ Value HW_TYPE (\w+)
Value MAC_ADDRESS (\S+)
Value MTU (\d+)
Value IF_TYPE (\S+)
Value IP_ADDRESS (\S+)
Value DUPLEX (\w+)
Value QOS_TRUST (\S+)
Value SPEED (\S+\s\S+)
Expand All @@ -16,6 +17,9 @@ Value FLOW_CONTROL (\S+)
Value ERROR_CONTROL (\S+)
Value VLAN_MODE (\S+)
Value VLAN_ACCESS (\S+)
Value VLAN_NATIVE (\S+)
Value List VLAN_TRUNK ([^,]+)
Value List AGGREGATED_INTERFACES (\S+)
Value RX_TOTAL_PACKETS (\d+)
Value RX_TOTAL_BYTES (\d+)
Value RX_UNICAST_PACKETS (\d+)
Expand All @@ -31,28 +35,58 @@ Value TX_MCAST_PACKETS (\d+)
Value TX_BROADCAST_PACKETS (\d+)
Value TX_ERRORS (\d+)
Value TX_DROPPED (\d+)
Value TX_CRC_FCS (\d+)
Value TX_CRC_FCS (\S+)
Value TX_COLLISION (\d+)

Start
^\s*Interface\s*${INTERFACE}\s*is\s*${LINK_STATUS}
^\s*(Interface|Aggregate)\s+\S+\s+is -> Continue.Record
^\s*(Interface|Aggregate)\s+${INTERFACE}\s+is\s+${LINK_STATUS}
^\s*Admin\s*state\s*is\s*${LINK_ADMIN}
^\s*Link\s*transitions:\s*${LINK_TRANSITIONS}
^\s*Description:\s${INTERFACE_DESC}
^\s*State\s*information:\s*${LINK_STATE_INFO}
^\s*Hardware:\s*${HW_TYPE},?\s*MAC\s*Address:\s+${MAC_ADDRESS}
^\s*Link\s*transitions\s*:\s*${LINK_TRANSITIONS}
^\s*Description\s*:\s*${INTERFACE_DESC}
^\s*State\s*information\s*:\s*${LINK_STATE_INFO}
^\s*Hardware\s*:\s*${HW_TYPE},?\s*MAC\s*Address:\s+${MAC_ADDRESS}
^\s*MAC\s+Address\s*:\s*${MAC_ADDRESS}
^\s*IPv4\s+address\s+${IP_ADDRESS}
^\s*MTU\s*${MTU}
^\s*Type\s*${IF_TYPE}
^\s*${DUPLEX}-duplex
^\s*qos\s*trust\s*${QOS_TRUST}
^\s*Speed\s*${SPEED}
^\s*Speed\s*:*\s*${SPEED}
^\s*Auto-negotiation\s*is\s*${AUTO_NEG}
^\s*Flow-control: ${FLOW_CONTROL}
^\s*Error-control: ${ERROR_CONTROL}
^\s*VLAN Mode: ${VLAN_MODE}
^\s*Access VLAN: ${VLAN_ACCESS}
^\s*Flow-control\s*:\s*${FLOW_CONTROL}
^\s*Error-control\s*:\s*${ERROR_CONTROL}
^\s*VLAN Mode\s*:\s*${VLAN_MODE}
^\s*Access VLAN\s*:\s*${VLAN_ACCESS}
^\s*Native VLAN\s*:\s*${VLAN_NATIVE}
^\s*Allowed VLAN List\s*:\s+${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:\s+(?:[^,]+,){1}${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:\s+(?:[^,]+,){2}${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:\s+(?:[^,]+,){3}${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:\s+(?:[^,]+,){4}${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:\s+(?:[^,]+,){5}${VLAN_TRUNK},* -> Continue
^\s*Allowed VLAN List\s*:
^\s*Link state
^\s*Aggregated-interfaces\s*:\s+${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){1}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){2}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){3}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){4}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){5}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){6}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:\s+(?:\S+\s+){7}${AGGREGATED_INTERFACES}\s* -> Continue
^\s*Aggregated-interfaces\s*:
^\s*Aggregation-key
^\s*Aggregate\s+mode
^\s*Persona
^\s*rate-limit\s+broadcast
^\s*L3\s+Counters
^\s*MDI mode
^\s*Rate collection interval
^\s*Energy-Efficient
^\s*Rx -> Rx
^\s*Description:
^\s*Rate\s+RX\s+TX\s+Total -> Rate
^\s*Statistic\s+RX\s+TX\s+Total -> Statistic
^. -> Error

Rx
Expand All @@ -73,5 +107,36 @@ Tx
^\s*${TX_ERRORS} errors\s*${TX_DROPPED} dropped
^\s*${TX_CRC_FCS} CRC/FCS
^\s*${TX_COLLISION}\s*collision
^\s*$$ -> Record Start
^. -> Error
^\s*$$ -> Start
^. -> Error

Rate
^\s*----
^\s*Mbits\s+/\s+sec
^\s*KPkts\s+/\s+sec
^\s+Unicast
^\s+Multicast
^\s+Broadcast
^\s+Utilization
^\s*$$ -> Statistic
^. -> Error

Statistic
^\s*Statistic\s+RX\s+TX\s+Total
^\s*----
^\s*Packets\s+${RX_TOTAL_PACKETS}\s+${TX_TOTAL_PACKETS}\s+\d+
^\s+Unicast\s+${RX_UNICAST_PACKETS}\s+${TX_UNICAST_PACKETS}\s+\d+
^\s+Multicast\s+${RX_MCAST_PACKETS}\s+${TX_MCAST_PACKETS}\s+\d+
^\s+Broadcast\s+${RX_BROADCAST_PACKETS}\s+${TX_BROADCAST_PACKETS}\s+\d+
^\s*Bytes\s+${RX_TOTAL_BYTES}\s+${TX_TOTAL_BYTES}\s+\d+
^\s*Jumbos
^\s*Pause\s+Frames
^\s*Dropped\s+${RX_DROPPED}\s+${TX_DROPPED}\s+\d+
^\s*Errors\s+${RX_ERRORS}\s+${TX_ERRORS}\s+\d+
^\s+CRC/FCS\s+${RX_CRC_FCS}\s+${TX_CRC_FCS}\s+\d+
^\s+Collision\s+\S+\s+${TX_COLLISION}\s+\d+
^\s*Runts
^\s*Giants
^\s*L3\s+Packets
^\s*$$ -> Start
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Value PORT_DESC (\S+)
Start
^Port\s*:\s*${LOCAL_PORT}
^Neighbor\s*Chassis-Name\s*:\s*${CHASSIS_NAME}
^Neighbor\s+System-Name\s*:\s*${CHASSIS_NAME}
^Neighbor\s*Chassis-Description\s*:\s*${CHASSIS_DESC}
^Neighbor\s+System-Description\s*:\s*${CHASSIS_DESC}
^Neighbor\s*Chassis-ID\s*:\s*${CHASSIS_ID}
^Neighbor\s*Management-Address\s*:\s*${MGMT_ADDR}
^Chassis\s*Capabilities\s*Available\s*:\s*${CAPABILITIES}
Expand All @@ -24,9 +26,12 @@ Start
^TTL\.*
^P[D|SE]\.*
^Power\.*
^MED\s+capabilities
^\s+ -> Next
^\S+#\.* -> Next
^LLDP\.*
^Link\s+aggregation
^Aggregation\s+port
^Total\.*
^=+
^. -> Error
Expand Down
34 changes: 34 additions & 0 deletions ntc_templates/templates/aruba_aoscx_show_vlan.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Value Required VLAN_ID (\d+)
Value VLAN_NAME (\S+)
Value STATUS (\S+)
Value REASON (\S+)
Value TYPE (\S+)
Value List INTERFACES ([^,]+)

Start
^---
^VLAN\s+Name\s+Status -> VLANS
^. -> Error

VLANS
^---
^\d+ -> Continue.Record
# Lines starting with VLAN ID
^${VLAN_ID}\s+${VLAN_NAME}\s+${STATUS}\s+${REASON}\s+${TYPE}\s*$$
^${VLAN_ID}\s+${VLAN_NAME}\s+${STATUS}\s+${REASON}\s+${TYPE}\s+${INTERFACES},* -> Continue
^\d+\s+(?:\S+\s+){4}(?:[^,]+,){1}${INTERFACES},* -> Continue
^\d+\s+(?:\S+\s+){4}(?:[^,]+,){2}${INTERFACES},* -> Continue
^\d+\s+(?:\S+\s+){4}(?:[^,]+,){3}${INTERFACES},* -> Continue
^\d+\s+(?:\S+\s+){4}(?:[^,]+,){4}${INTERFACES},* -> Continue
^\d+\s+(?:\S+\s+){4}(?:[^,]+,){5}${INTERFACES},* -> Continue
# Lines starting with multiple spaces
^\s{6,}${INTERFACES},* -> Continue
^\s{6,}(?:[^,]+,){1}${INTERFACES},* -> Continue
^\s{6,}(?:[^,]+,){2}${INTERFACES},* -> Continue
^\s{6,}(?:[^,]+,){3}${INTERFACES},* -> Continue
^\s{6,}(?:[^,]+,){4}${INTERFACES},* -> Continue
^\s{6,}(?:[^,]+,){5}${INTERFACES},* -> Continue
# Dropping lines
^\d+\s+\S+\s+\S+\s+\S+\s+\S+\s*
^\s{6,}
^.+ -> Error
7 changes: 4 additions & 3 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ aruba_aoscx_show_mac-address-table.textfsm, .*, aruba_aoscx, sh[[ow]] ma[[c-addr
aruba_aoscx_show_ntp_associations.textfsm, .*, aruba_aoscx, sh[[ow]] ntp as[[sociations]]
aruba_aoscx_show_arp_all-vrfs.textfsm, .*, aruba_aoscx, sh[[ow]] ar[[p]] a[[ll-vrfs]]
aruba_aoscx_show_bfd_all-vrfs.textfsm, .*, aruba_aoscx, sh[[ow]] bf[[d]] a[[ll-vrfs]]
aruba_aoscx_show_vsf_detail.textfsm , .*, aruba_aoscx, sh[[ow]] vsf d[[etail]]
aruba_aoscx_show_interface.textfsm , .*, aruba_aoscx, sh[[ow]] int[[erface]]
aruba_aoscx_show_system.textfsm , .*, aruba_aoscx, sh[[ow]] sys[[tem]]
aruba_aoscx_show_vsf_detail.textfsm, .*, aruba_aoscx, sh[[ow]] vsf d[[etail]]
aruba_aoscx_show_interface.textfsm, .*, aruba_aoscx, sh[[ow]] int[[erface]]
aruba_aoscx_show_system.textfsm, .*, aruba_aoscx, sh[[ow]] sys[[tem]]
aruba_aoscx_show_vlan.textfsm, .*, aruba_aoscx, sh[[ow]] vl[[an]]

aruba_os_show_ap_bss-table_details.textfsm, .*, aruba_os, show ap bss-table details
aruba_os_show_ipv6_interface_brief.textfsm, .*, aruba_os, sh[[ow]] ipv6 in[[terface]] b[[rief]]
Expand Down
68 changes: 68 additions & 0 deletions tests/aruba_aoscx/show_interface/show_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: ""
vlan_mode: ""
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -70,6 +74,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: ""
vlan_mode: ""
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -105,6 +113,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -140,6 +152,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -175,6 +191,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -210,6 +230,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -245,6 +269,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -280,6 +308,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -315,6 +347,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -350,6 +386,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -385,6 +425,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -420,6 +464,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -455,6 +503,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -490,6 +542,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -525,6 +581,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -560,6 +620,10 @@ parsed_sample:
tx_unicast_packets: "0"
vlan_access: "1"
vlan_mode: "access"
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
- auto_neg: "on"
duplex: "Full"
error_control: "off"
Expand Down Expand Up @@ -595,3 +659,7 @@ parsed_sample:
tx_unicast_packets: ""
vlan_access: ""
vlan_mode: ""
ip_address: ""
vlan_trunk: []
vlan_native: ""
aggregated_interfaces: []
Loading

0 comments on commit b877d06

Please sign in to comment.