diff --git a/templates/cisco_ios_show_interfaces_switchport.textfsm b/templates/cisco_ios_show_interfaces_switchport.textfsm index 2bd64f3ee0..ad84de8974 100644 --- a/templates/cisco_ios_show_interfaces_switchport.textfsm +++ b/templates/cisco_ios_show_interfaces_switchport.textfsm @@ -1,25 +1,26 @@ Value Required INTERFACE (\S+) -Value SWITCHPORT (.+) -Value SWITCHPORT_MONITOR (.+) -Value SWITCHPORT_NEGOTIATION (.+) -Value MODE (.+) -Value ACCESS_VLAN (\d+) +Value SWITCHPORT (.+?) +Value SWITCHPORT_MONITOR (.+?) +Value SWITCHPORT_NEGOTIATION (.+?) +Value MODE (.+?) +Value ADMIN_MODE (.+?) +Value ACCESS_VLAN (\d+|unassigned) Value NATIVE_VLAN (\d+) Value VOICE_VLAN (\S+) -Value TRUNKING_VLANS (.+) +Value TRUNKING_VLANS (.+?) Start ^Name: -> Continue.Record ^Name:\s+${INTERFACE} - ^\s*Switchport:\s+${SWITCHPORT} - ^\s*Switchport\s+Monitor:\s+${SWITCHPORT_MONITOR} - ^\s*Operational\s+Mode:\s+${MODE} - ^\s*Negotiation\s+of\s+Trunking:\s+${SWITCHPORT_NEGOTIATION} + ^\s*Switchport:\s+${SWITCHPORT}$$ + ^\s*Switchport\s+Monitor:\s+${SWITCHPORT_MONITOR}$$ + ^\s*Operational\s+Mode:\s+${MODE}$$ + ^\s*Negotiation\s+of\s+Trunking:\s+${SWITCHPORT_NEGOTIATION}$$ ^\s*Access\s+Mode\s+VLAN:\s+${ACCESS_VLAN} ^\s*Trunking\s+Native\s+Mode\s+VLAN:\s+${NATIVE_VLAN} ^\s*Voice\s+VLAN:\s+${VOICE_VLAN} - ^\s*Trunking\s+VLANs\s+Enabled:\s+${TRUNKING_VLANS} - ^\s*Administrative\s+Mode + ^\s*Trunking\s+VLANs\s+Enabled:\s+${TRUNKING_VLANS}$$ + ^\s*Administrative\s+Mode:\s+${ADMIN_MODE}$$ ^\s*(?:Operational|Administrative)\s+(?:Trunking|Native\s+VLAN|private-vlan) ^\s*Voice\s+VLAN: ^\s*Pruning\s+VLANs diff --git a/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport.yml b/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport.yml index 6a55bb916a..eb695543f0 100644 --- a/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport.yml +++ b/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport.yml @@ -1,56 +1,62 @@ --- parsed_sample: - - access_vlan: "1" - interface: "Gi0/1" - mode: "trunk" - native_vlan: "1" + - interface: "Gi0/1" switchport: "Enabled" - switchport_negotiation: "Off" switchport_monitor: "" + switchport_negotiation: "Off" + mode: "trunk" + admin_mode: "trunk" + access_vlan: "1" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "100" - interface: "Gi0/2" - mode: "static access" - native_vlan: "1" + - interface: "Gi0/2" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" - voice_vlan: "none" - trunking_vlans: "ALL" - - access_vlan: "101" - interface: "Gi0/3" + switchport_negotiation: "On" mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "100" native_vlan: "1" - switchport: "Enabled" - switchport_negotiation: "On" - switchport_monitor: "" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "110" - interface: "Gi1/0" - mode: "static access" - native_vlan: "1" + - interface: "Gi0/3" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" - voice_vlan: "none" - trunking_vlans: "ALL" - - access_vlan: "111" - interface: "Gi1/1" + switchport_negotiation: "On" mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "101" native_vlan: "1" + voice_vlan: "none" + trunking_vlans: "ALL" + - interface: "Gi1/0" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" + switchport_negotiation: "On" + mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "110" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "1" - interface: "Fa0/1" + - interface: "Gi1/1" + switchport: "Enabled" + switchport_monitor: "" + switchport_negotiation: "On" mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "111" native_vlan: "1" + voice_vlan: "none" + trunking_vlans: "ALL" + - interface: "Fa0/1" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" + switchport_negotiation: "On" + mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "1" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL" diff --git a/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport_voice_vlan.yml b/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport_voice_vlan.yml index d3c01c3a71..34319bcddc 100644 --- a/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport_voice_vlan.yml +++ b/tests/cisco_ios/show_interfaces_switchport/cisco_ios_show_interfaces_switchport_voice_vlan.yml @@ -1,47 +1,52 @@ --- parsed_sample: - - access_vlan: "1" - interface: "Gi0/1" - mode: "trunk" - native_vlan: "1" + - interface: "Gi0/1" switchport: "Enabled" - switchport_negotiation: "Off" switchport_monitor: "" + switchport_negotiation: "Off" + mode: "trunk" + admin_mode: "trunk" + access_vlan: "1" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "100" - interface: "Gi0/2" - mode: "static access" - native_vlan: "1" + - interface: "Gi0/2" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" - voice_vlan: "none" - trunking_vlans: "ALL" - - access_vlan: "101" - interface: "Gi0/3" + switchport_negotiation: "On" mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "100" native_vlan: "1" - switchport: "Enabled" - switchport_negotiation: "On" - switchport_monitor: "" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "110" - interface: "Gi1/0" - mode: "static access" - native_vlan: "1" + - interface: "Gi0/3" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" + switchport_negotiation: "On" + mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "101" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL" - - access_vlan: "111" - interface: "Gi1/1" + - interface: "Gi1/0" + switchport: "Enabled" + switchport_monitor: "" + switchport_negotiation: "On" mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "110" native_vlan: "1" + voice_vlan: "none" + trunking_vlans: "ALL" + - interface: "Gi1/1" switchport: "Enabled" - switchport_negotiation: "On" switchport_monitor: "" + switchport_negotiation: "On" + mode: "static access" + admin_mode: "dynamic auto" + access_vlan: "111" + native_vlan: "1" voice_vlan: "none" trunking_vlans: "ALL"