From 80f6a2949a06ed482684d68f9359cdfdd9eb8b85 Mon Sep 17 00:00:00 2001 From: daanvdsanden Date: Fri, 6 Mar 2020 16:33:34 +0100 Subject: [PATCH] enhancement: cisco_nxos_show_interfaces_switchport: Added access_vlan_name and native_vlan_name --- templates/cisco_nxos_show_interfaces_switchport.textfsm | 4 ++++ .../cisco_nxos_show_interfaces_switchport.yml | 6 ++++++ .../cisco_nxos_show_interfaces_switchport_voice_vlan.yml | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/templates/cisco_nxos_show_interfaces_switchport.textfsm b/templates/cisco_nxos_show_interfaces_switchport.textfsm index 7460c85a32..cd92135cab 100644 --- a/templates/cisco_nxos_show_interfaces_switchport.textfsm +++ b/templates/cisco_nxos_show_interfaces_switchport.textfsm @@ -3,7 +3,9 @@ Value SWITCHPORT (.+) Value SWITCHPORT_MONITOR (.+) Value MODE (.+) Value ACCESS_VLAN (\d+) +Value ACCESS_VLAN_NAME (.+) Value NATIVE_VLAN (\d+) +Value NATIVE_VLAN_NAME (.+) Value TRUNKING_VLANS (\S+) Value VOICE_VLAN (\S+) @@ -13,7 +15,9 @@ Start ^\s*Switchport:\s+${SWITCHPORT} ^\s*Switchport\s+Monitor:\s+${SWITCHPORT_MONITOR} ^\s*Operational\s+Mode:\s+${MODE} + ^\s*Access\s+Mode\s+VLAN:\s+${ACCESS_VLAN}\s+\(${ACCESS_VLAN_NAME}\) ^\s*Access\s+Mode\s+VLAN:\s+${ACCESS_VLAN} + ^\s*Trunking\s+Native\s+Mode\s+VLAN:\s+${NATIVE_VLAN}\s+\(${NATIVE_VLAN_NAME}\) ^\s*Trunking\s+Native\s+Mode\s+VLAN:\s+${NATIVE_VLAN} ^\s*Trunking\s+VLANs\s+Allowed:\s+${TRUNKING_VLANS} ^\s*Voice\s+VLAN:\s+${VOICE_VLAN} diff --git a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.yml b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.yml index 739ee93e38..8d1c0b6473 100644 --- a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.yml +++ b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport.yml @@ -5,7 +5,9 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "access" access_vlan: "3" + access_vlan_name: "Vlan not created" native_vlan: "1" + native_vlan_name: "default" trunking_vlans: "1-4094" voice_vlan: "none" - interface: "Ethernet1/2" @@ -13,7 +15,9 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "trunk" access_vlan: "1" + access_vlan_name: "default" native_vlan: "5" + native_vlan_name: "Vlan not created" trunking_vlans: "1-4094" voice_vlan: "none" - interface: "Ethernet1/3" @@ -21,6 +25,8 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "trunk" access_vlan: "1" + access_vlan_name: "default" native_vlan: "1" + native_vlan_name: "default" trunking_vlans: "1-4094" voice_vlan: "none" diff --git a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport_voice_vlan.yml b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport_voice_vlan.yml index 739ee93e38..8d1c0b6473 100644 --- a/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport_voice_vlan.yml +++ b/tests/cisco_nxos/show_interfaces_switchport/cisco_nxos_show_interfaces_switchport_voice_vlan.yml @@ -5,7 +5,9 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "access" access_vlan: "3" + access_vlan_name: "Vlan not created" native_vlan: "1" + native_vlan_name: "default" trunking_vlans: "1-4094" voice_vlan: "none" - interface: "Ethernet1/2" @@ -13,7 +15,9 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "trunk" access_vlan: "1" + access_vlan_name: "default" native_vlan: "5" + native_vlan_name: "Vlan not created" trunking_vlans: "1-4094" voice_vlan: "none" - interface: "Ethernet1/3" @@ -21,6 +25,8 @@ parsed_sample: switchport_monitor: "Not enabled" mode: "trunk" access_vlan: "1" + access_vlan_name: "default" native_vlan: "1" + native_vlan_name: "default" trunking_vlans: "1-4094" voice_vlan: "none"