From f5bebb6f38078bad5aa5ad233b4428f7fb02c0ed Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Wed, 25 Dec 2024 15:27:51 -0500 Subject: [PATCH] Fix ios sh int status private vlan (pvlan) bug --- .../cisco_ios_show_interfaces_status.textfsm | 2 +- ...cisco_ios_show_interfaces_status_pvlan.raw | 9 +++ ...cisco_ios_show_interfaces_status_pvlan.yml | 58 +++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.raw create mode 100644 tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.yml diff --git a/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm b/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm index c1d4e081f0..d156d950a0 100644 --- a/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm +++ b/ntc_templates/templates/cisco_ios_show_interfaces_status.textfsm @@ -1,7 +1,7 @@ Value PORT (\S+) Value NAME (.+?) Value STATUS (err-disabled|disabled|connected|notconnect|inactive|up|down|monitoring|suspended) -Value VLAN_ID (\d+|trunk|routed|unassigned) +Value VLAN_ID (\d+(,\d+)*|trunk|routed|unassigned|pvlan\s+prom) Value DUPLEX (\S+) Value SPEED (\S+) Value TYPE (.*) diff --git a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.raw b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.raw new file mode 100644 index 0000000000..894166ba40 --- /dev/null +++ b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.raw @@ -0,0 +1,9 @@ + +Port Name Status Vlan Duplex Speed Type +Twe1/0/1 Device 1 connected 123 a-full a-1000 10/100/1000BaseTX SFP +Twe1/0/2 Device 2 disabled 456 auto auto 10/100/1000BaseTX SFP +Twe1/0/4 * Device 3 * connected 123,1234 a-full a-1000 10/100/1000BaseTX SFP +Twe1/0/5 Device 4 disabled 2345 auto auto 10/100/1000BaseTX SFP +Twe1/0/17 Device 5 connected pvlan prom full 10G SFP-10GBase-SR +Twe1/0/28 Device 6 notconnect 123 auto auto 10/100/1000BaseTX SFP +Twe2/0/32 monitoring 1 full 10G SFP-10GBase-SR \ No newline at end of file diff --git a/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.yml b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.yml new file mode 100644 index 0000000000..0fff73999d --- /dev/null +++ b/tests/cisco_ios/show_interfaces_status/cisco_ios_show_interfaces_status_pvlan.yml @@ -0,0 +1,58 @@ +--- +parsed_sample: + - duplex: "a-full" + fc_mode: "" + name: "Device 1" + port: "Twe1/0/1" + speed: "a-1000" + status: "connected" + type: "10/100/1000BaseTX SFP" + vlan_id: "123" + - duplex: "auto" + fc_mode: "" + name: "Device 2" + port: "Twe1/0/2" + speed: "auto" + status: "disabled" + type: "10/100/1000BaseTX SFP" + vlan_id: "456" + - duplex: "a-full" + fc_mode: "" + name: "* Device 3 *" + port: "Twe1/0/4" + speed: "a-1000" + status: "connected" + type: "10/100/1000BaseTX SFP" + vlan_id: "123,1234" + - duplex: "auto" + fc_mode: "" + name: "Device 4" + port: "Twe1/0/5" + speed: "auto" + status: "disabled" + type: "10/100/1000BaseTX SFP" + vlan_id: "2345" + - duplex: "full" + fc_mode: "" + name: "Device 5" + port: "Twe1/0/17" + speed: "10G" + status: "connected" + type: "SFP-10GBase-SR" + vlan_id: "pvlan prom" + - duplex: "auto" + fc_mode: "" + name: "Device 6" + port: "Twe1/0/28" + speed: "auto" + status: "notconnect" + type: "10/100/1000BaseTX SFP" + vlan_id: "123" + - duplex: "full" + fc_mode: "" + name: "" + port: "Twe2/0/32" + speed: "10G" + status: "monitoring" + type: "SFP-10GBase-SR" + vlan_id: "1"