From dcdc351b36843f3ebffdbcdcc00deaf7137b5d29 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 24 Apr 2026 20:30:16 -0400 Subject: [PATCH 1/2] Fix nxos sh int status to support tunnels --- .../cisco_nxos_show_interface_status.textfsm | 2 + ...isco_nxos_show_interface_status_tunnel.raw | 16 +++++ ...isco_nxos_show_interface_status_tunnel.yml | 58 +++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw create mode 100644 tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml diff --git a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm index ce1ce42425..c179b9114d 100644 --- a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm +++ b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm @@ -9,6 +9,8 @@ Value TYPE (\S+(\s\S+)*) Start ^${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}(?:\s+${TYPE})?\s*$$ -> Record ^[Pp]ort\s+[Nn]ame\s+[Ss]tatus\s+[Vv]lan\s+[Dd]uplex\s+[Ss]peed\s+[Tt]ype\s*$$ + ^Interface\s+Name\s+Status\s+(Reason\s+){2}description\s*$$ + ^${PORT}\s+${NAME}\s+${STATUS}\s+\S+\s+\S+\s*$$ -> Record ^-+ ^\s*$$ ^. -> Error diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw new file mode 100644 index 0000000000..3953790184 --- /dev/null +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw @@ -0,0 +1,16 @@ + +-------------------------------------------------------------------------------- +Port Name Status Vlan Duplex Speed Type +-------------------------------------------------------------------------------- +mgmt0 -- connected routed full a-1000 -- +Eth1/1 TEST1 connected routed full a-10G 10Gbase-SR +Eth1/2 TEST2 connected trunk full a-10G 10Gbase-SR +Eth1/3 TEST3 disabled routed auto auto 10Gbase-SR + +------------------------------------------------------------------------------- +Interface Name Status Reason Reason description +------------------------------------------------------------------------------- +Tunnel13 Test Tun13 connected none none +Tunnel40 Test Tun40 connected none none +Tunnel41 Test Tun41 connected none none +Tunnel42 Test Tun42 connected none none \ No newline at end of file diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml new file mode 100644 index 0000000000..776a8623a1 --- /dev/null +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml @@ -0,0 +1,58 @@ +--- +parsed_sample: + - duplex: "full" + name: "--" + port: "mgmt0" + speed: "a-1000" + status: "connected" + type: "--" + vlan_id: "routed" + - duplex: "full" + name: "TEST1" + port: "Eth1/1" + speed: "a-10G" + status: "connected" + type: "10Gbase-SR" + vlan_id: "routed" + - duplex: "full" + name: "TEST2" + port: "Eth1/2" + speed: "a-10G" + status: "connected" + type: "10Gbase-SR" + vlan_id: "trunk" + - duplex: "auto" + name: "TEST3" + port: "Eth1/3" + speed: "auto" + status: "disabled" + type: "10Gbase-SR" + vlan_id: "routed" + - duplex: "" + name: "Test Tun13" + port: "Tunnel13" + speed: "" + status: "connected" + type: "" + vlan_id: "" + - duplex: "" + name: "Test Tun40" + port: "Tunnel40" + speed: "" + status: "connected" + type: "" + vlan_id: "" + - duplex: "" + name: "Test Tun41" + port: "Tunnel41" + speed: "" + status: "connected" + type: "" + vlan_id: "" + - duplex: "" + name: "Test Tun42" + port: "Tunnel42" + speed: "" + status: "connected" + type: "" + vlan_id: "" From 8bb7438223c3e3045934d167ef386ee8c117ff7a Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Sat, 25 Apr 2026 15:53:55 -0400 Subject: [PATCH 2/2] Update for tunnel down status and reasons --- .../templates/cisco_nxos_show_interface_status.textfsm | 5 +++-- .../cisco_nxos_show_interface_status_tunnel.raw | 7 ++++--- .../cisco_nxos_show_interface_status_tunnel.yml | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm index c179b9114d..5069ddf4b7 100644 --- a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm +++ b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm @@ -1,6 +1,6 @@ Value PORT (\S+) Value NAME (.*?) -Value STATUS (\S+) +Value STATUS (connected|notconnec|down|disabled|sfpAbsent|xcvrAbsen|channelDo|noOperMem) Value VLAN_ID (\d+|routed|trunk|f-path|--) Value DUPLEX (\S+) Value SPEED (\S+) @@ -10,7 +10,8 @@ Start ^${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}(?:\s+${TYPE})?\s*$$ -> Record ^[Pp]ort\s+[Nn]ame\s+[Ss]tatus\s+[Vv]lan\s+[Dd]uplex\s+[Ss]peed\s+[Tt]ype\s*$$ ^Interface\s+Name\s+Status\s+(Reason\s+){2}description\s*$$ - ^${PORT}\s+${NAME}\s+${STATUS}\s+\S+\s+\S+\s*$$ -> Record + ^${PORT}\s+${NAME}\s+${STATUS}\s+admin\s+down\s+\S+\s+\S+\s*$$ -> Record + ^${PORT}\s+${NAME}\s+${STATUS}\s+\S+(\s+\S+)?\s+.*?\s*$$ -> Record ^-+ ^\s*$$ ^. -> Error diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw index 3953790184..60d8cb6d61 100644 --- a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.raw @@ -11,6 +11,7 @@ Eth1/3 TEST3 disabled routed auto auto 10Gbase-SR Interface Name Status Reason Reason description ------------------------------------------------------------------------------- Tunnel13 Test Tun13 connected none none -Tunnel40 Test Tun40 connected none none -Tunnel41 Test Tun41 connected none none -Tunnel42 Test Tun42 connected none none \ No newline at end of file +Tunnel40 Test Tun40 down admin down Administratively down +Tunnel41 Test Tun41 down sourceNotConfigure tunnel source is not configured +Tunnel42 Test Tun42 down destinationNotConf tunnel destination is not configured + \ No newline at end of file diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml index 776a8623a1..aebf6aa28a 100644 --- a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status_tunnel.yml @@ -39,20 +39,20 @@ parsed_sample: name: "Test Tun40" port: "Tunnel40" speed: "" - status: "connected" + status: "down" type: "" vlan_id: "" - duplex: "" name: "Test Tun41" port: "Tunnel41" speed: "" - status: "connected" + status: "down" type: "" vlan_id: "" - duplex: "" name: "Test Tun42" port: "Tunnel42" speed: "" - status: "connected" + status: "down" type: "" vlan_id: ""