From 90dbeb4aecb1ca285a4be92ac15ed593c6a3f848 Mon Sep 17 00:00:00 2001 From: Mikhail Yohman Date: Mon, 15 Mar 2021 13:24:36 -0600 Subject: [PATCH] Bugfix: Type for cisco_nxos_show_interface_status (#880) --- .../cisco_nxos_show_interface_status.textfsm | 8 +- .../cisco_nxos_show_interface_status3.raw | 1 + .../cisco_nxos_show_interface_status3.yml | 109 ++++++++++-------- 3 files changed, 63 insertions(+), 55 deletions(-) diff --git a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm index 024141a729..5d142c9b3c 100644 --- a/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm +++ b/ntc_templates/templates/cisco_nxos_show_interface_status.textfsm @@ -4,11 +4,11 @@ Value STATUS (\S+) Value VLAN (\d+|routed|trunk|--) Value DUPLEX (\S+) Value SPEED (\S+) -Value TYPE (\S+|\S+\s+\S+) +Value TYPE (\S+(\s\S+)*) Start ^${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN}\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*$$ - ^-+\s*$$ - ^$$ - ^.*$$ -> Error + ^-+ + ^\s*$$ + ^. -> Error diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.raw b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.raw index 434aca5b33..05eeec8aa8 100644 --- a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.raw +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.raw @@ -14,3 +14,4 @@ Eth1/10 -- channelDo 1 full 10G Fabric Exte Eth1/11 -- channelDo 1 full 10G Fabric Exte Eth1/12 -- channelDo 1 full 10G Fabric Exte Eth1/13 upk N2232PP-651-10 connected 1 full 10G Fabric Exte +Eth1/39 "FEX151" connected 1 full 10G Fabric Extender Transceiver diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.yml b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.yml index 8733852232..abc118c072 100644 --- a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.yml +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status3.yml @@ -1,93 +1,100 @@ --- parsed_sample: - - duplex: "full" + - port: "Eth1/1" name: "upk peerLink_XXXX" - port: "Eth1/1" - speed: "10G" status: "connected" - type: "10Gbase-SR" vlan: "trunk" - - duplex: "full" - name: "upk peerLink_XXXX" - port: "Eth1/2" + duplex: "full" speed: "10G" - status: "connected" type: "10Gbase-SR" - vlan: "trunk" - - duplex: "full" + - port: "Eth1/2" name: "upk peerLink_XXXX" - port: "Eth1/3" - speed: "10G" status: "connected" - type: "10Gbase-SR" vlan: "trunk" - - duplex: "full" - name: "upk peerLink_XXXX" - port: "Eth1/4" + duplex: "full" speed: "10G" - status: "connected" type: "10Gbase-SR" - vlan: "trunk" - - duplex: "full" + - port: "Eth1/3" name: "upk peerLink_XXXX" - port: "Eth1/5" - speed: "10G" status: "connected" - type: "10Gbase-SR" vlan: "trunk" - - duplex: "full" - name: "upk peerLink_XXXX" - port: "Eth1/6" + duplex: "full" speed: "10G" - status: "connected" type: "10Gbase-SR" - vlan: "trunk" - - duplex: "full" + - port: "Eth1/4" name: "upk peerLink_XXXX" - port: "Eth1/7" - speed: "10G" status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" type: "10Gbase-SR" + - port: "Eth1/5" + name: "upk peerLink_XXXX" + status: "connected" vlan: "trunk" - - duplex: "full" + duplex: "full" + speed: "10G" + type: "10Gbase-SR" + - port: "Eth1/6" name: "upk peerLink_XXXX" - port: "Eth1/8" + status: "connected" + vlan: "trunk" + duplex: "full" speed: "10G" + type: "10Gbase-SR" + - port: "Eth1/7" + name: "upk peerLink_XXXX" status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" type: "10Gbase-SR" + - port: "Eth1/8" + name: "upk peerLink_XXXX" + status: "connected" vlan: "trunk" - - duplex: "full" - name: "--" - port: "Eth1/9" + duplex: "full" speed: "10G" + type: "10Gbase-SR" + - port: "Eth1/9" + name: "--" status: "channelDo" - type: "Fabric Exte" vlan: "1" - - duplex: "full" - name: "--" - port: "Eth1/10" + duplex: "full" speed: "10G" - status: "channelDo" type: "Fabric Exte" - vlan: "1" - - duplex: "full" + - port: "Eth1/10" name: "--" - port: "Eth1/11" - speed: "10G" status: "channelDo" - type: "Fabric Exte" vlan: "1" - - duplex: "full" - name: "--" - port: "Eth1/12" + duplex: "full" speed: "10G" + type: "Fabric Exte" + - port: "Eth1/11" + name: "--" status: "channelDo" + vlan: "1" + duplex: "full" + speed: "10G" type: "Fabric Exte" + - port: "Eth1/12" + name: "--" + status: "channelDo" vlan: "1" - - duplex: "full" - name: "upk N2232PP-651-10" - port: "Eth1/13" + duplex: "full" speed: "10G" + type: "Fabric Exte" + - port: "Eth1/13" + name: "upk N2232PP-651-10" status: "connected" + vlan: "1" + duplex: "full" + speed: "10G" type: "Fabric Exte" + - port: "Eth1/39" + name: "\"FEX151\"" + status: "connected" vlan: "1" + duplex: "full" + speed: "10G" + type: "Fabric Extender Transceiver"