From 63be84509eb09c117a0d837b3da56cb0111332c9 Mon Sep 17 00:00:00 2001 From: John Capretta Date: Mon, 14 Jan 2019 12:19:57 +1100 Subject: [PATCH] `cisco_nxos_show_interface_status`: Fixes issue #331 * added new test files * modified template --- .../cisco_nxos_show_interface_status.template | 2 +- .../cisco_nxos_show_interface_status1.parsed | 75 +++++++++++++++++++ .../cisco_nxos_show_interface_status1.raw | 13 ++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.parsed create mode 100644 tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.raw diff --git a/templates/cisco_nxos_show_interface_status.template b/templates/cisco_nxos_show_interface_status.template index 40a403b5ea..de3f2eeb06 100644 --- a/templates/cisco_nxos_show_interface_status.template +++ b/templates/cisco_nxos_show_interface_status.template @@ -3,7 +3,7 @@ Value NAME (.*?) Value STATUS (\S+) Value VLAN (\d+|routed|trunk) Value DUPLEX (\S+) -Value SPEED (\d+|auto) +Value SPEED (\d+G?|auto) Value TYPE (.+?) Start diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.parsed b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.parsed new file mode 100644 index 0000000000..a82ab287c5 --- /dev/null +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.parsed @@ -0,0 +1,75 @@ +--- +parsed_sample: + + - port: "mgmt0" + name: "--" + status: "connected" + vlan: "routed" + duplex: "full" + speed: "1000" + type: "--" + + - port: "Eth1/1" + name: "interface1" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + + - port: "Eth1/2" + name: "interface2" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + + - port: "Eth1/3" + name: "interface3" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR" + + - port: "Eth1/4" + name: "interface4" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR" + + - port: "Eth1/5" + name: "interface5" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + + - port: "Eth1/6" + name: "interface6" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + + - port: Eth1/7 + name: "interface7" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + + - port: "Eth1/8" + name: "interface8" + status: "connected" + vlan: "trunk" + duplex: "full" + speed: "10G" + type: "10Gbase-SR-S" + diff --git a/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.raw b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.raw new file mode 100644 index 0000000000..388d93bed4 --- /dev/null +++ b/tests/cisco_nxos/show_interface_status/cisco_nxos_show_interface_status1.raw @@ -0,0 +1,13 @@ + +-------------------------------------------------------------------------------- +Port Name Status Vlan Duplex Speed Type +-------------------------------------------------------------------------------- +mgmt0 -- connected routed full 1000 -- +Eth1/1 interface1 connected trunk full 10G 10Gbase-SR-S +Eth1/2 interface2 connected trunk full 10G 10Gbase-SR-S +Eth1/3 interface3 connected trunk full 10G 10Gbase-SR +Eth1/4 interface4 connected trunk full 10G 10Gbase-SR +Eth1/5 interface5 connected trunk full 10G 10Gbase-SR-S +Eth1/6 interface6 connected trunk full 10G 10Gbase-SR-S +Eth1/7 interface7 connected trunk full 10G 10Gbase-SR-S +Eth1/8 interface8 connected trunk full 10G 10Gbase-SR-S