From 0a89cd5a60ef5a7c8ab6528624b1c2e980eb14f6 Mon Sep 17 00:00:00 2001 From: Thomas Christie Date: Thu, 19 Dec 2024 13:19:08 -0600 Subject: [PATCH] status regex includes non-whitespace --- .../cisco_ios_show_interfaces_status.textfsm | 2 +- .../cisco_ios_show_interfaces_status.raw | 2 ++ .../cisco_ios_show_interfaces_status.yml | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm b/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm index c1d4e081f0..b57bbe02d6 100644 --- a/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm +++ b/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm @@ -21,7 +21,7 @@ Interfaces ^\s*${PORT}\s+is\s+${STATUS}\s+Port\s+mode\s+is\s+${FC_MODE}\s*$$ -> Record ^\s*${PORT}\s+is\s+${STATUS}\s+\(${TYPE}\)\s*$$ -> Record ^\s*${PORT}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}$$ -> Record - ^\s*${PORT}\s+${NAME}\s+${STATUS}:?\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}\s*$$ -> Record + ^\s*${PORT}\s+${NAME}\s+${STATUS}:?.*\s${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}\s*$$ -> Record ^-+ ^\s*$$ ^. -> Error diff --git a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.raw b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.raw index 02a2d59afc..1df5197ec5 100644 --- a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.raw +++ b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.raw @@ -20,5 +20,7 @@ Gi1/0/18 Monitoring Port monitoring routed a-full auto 10/100/1000Ba Gi1/0/19 No Description notconnect: 1 a-full a-100 10/100/1000BaseTX Gi1/0/20 No Description connected: 1 a-full a-100 10/100/1000BaseTX Gi1/0/21 Monitoring Port monitoring unassigned a-full auto 10/100/1000BaseT +Gi1/0/22 addl status text notconnect: TD 1 a-full a-100 10/100/1000BaseTX +Gi1/0/23 addl status text connected: TDR 1 a-full a-100 10/100/1000BaseTX Fa1/6 test notconnect 1 auto auto 10/100BaseTX Po1 ethchl connected trunk a-full a-1000 diff --git a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.yml b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.yml index e2fe22d550..2c4df10190 100644 --- a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.yml +++ b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status.yml @@ -168,6 +168,22 @@ parsed_sample: status: "monitoring" type: "10/100/1000BaseT" vlan_id: "unassigned" + - duplex: "a-full" + fc_mode: "" + name: "addl status text" + port: "Gi1/0/22" + speed: "a-100" + status: "notconnect" + type: "10/100/1000BaseTX" + vlan_id: "1" + - duplex: "a-full" + fc_mode: "" + name: "addl status text" + port: "Gi1/0/23" + speed: "a-100" + status: "connected" + type: "10/100/1000BaseTX" + vlan_id: "1" - duplex: "auto" fc_mode: "" name: "test"