diff --git a/ntc_templates/templates/cisco_s300_show_interfaces_description.textfsm b/ntc_templates/templates/cisco_s300_show_interfaces_description.textfsm new file mode 100644 index 0000000000..b407a0e09e --- /dev/null +++ b/ntc_templates/templates/cisco_s300_show_interfaces_description.textfsm @@ -0,0 +1,21 @@ +Value INTERFACE (\S+) +Value DESCRIPTION (\S.*?) + +Start + ^\s*Port\s+Description\s*$$ -> Column1 + ^\s*Ch\s+Description\s*$$ -> Column2 + ^\s*$$ + ^. -> Error + +Column1 + ^(\s*-*)*\s*$$ + ^\s*Ch\s+Description\s*$$ -> Column2 + ^\s*${INTERFACE}(\s+${DESCRIPTION})?\s*$$ -> Record + ^\s*$$ + ^. -> Error + +Column2 + ^(\s*-*)*\s*$$ + ^\s*${INTERFACE}(\s+${DESCRIPTION})?\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 4a0120768f..1ba33994e3 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -379,6 +379,7 @@ cisco_nxos_show_vdc.textfsm, .*, cisco_nxos, sh[[ow]] vdc cisco_nxos_show_vpc.textfsm, .*, cisco_nxos, sh[[ow]] vpc cisco_nxos_show_vrf.textfsm, .*, cisco_nxos, sh[[ow]] vrf +cisco_s300_show_interfaces_description.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] description cisco_s300_show_interfaces_switchport.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] switchport cisco_s300_show_interfaces_status.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] st[[atus]] cisco_s300_show_mac_address-table.textfsm, .*, cisco_s300, sh[[ow]] mac address-[[table]] diff --git a/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.raw b/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.raw new file mode 100644 index 0000000000..c6f62874da --- /dev/null +++ b/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.raw @@ -0,0 +1,41 @@ +Port Description +------- ----------- +fa1 Test +fa2 Printer +fa3 Socket_7/7 +fa4 Socket_7/3 +fa5 +fa6 +fa7 +fa8 Camera +fa9 Camera +fa10 Camera +fa11 +fa12 Socket_7/2 +fa13 Socket_7/4 +fa14 Socket_7/8 +fa15 +fa16 +fa17 +fa18 +fa19 +fa20 +fa21 +fa22 +fa23 AP +fa24 AP +gi1 +gi2 +gi3 +gi4 Eltex2124-8 - gi1/0/5 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 +Po5 +Po6 +Po7 +Po8 diff --git a/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.yml b/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.yml new file mode 100644 index 0000000000..55075729ef --- /dev/null +++ b/tests/cisco_s300/show_interfaces_description/cisco_s300_show_interfaces_description.yml @@ -0,0 +1,74 @@ +--- +parsed_sample: + - description: "Test" + interface: "fa1" + - description: "Printer" + interface: "fa2" + - description: "Socket_7/7" + interface: "fa3" + - description: "Socket_7/3" + interface: "fa4" + - description: "" + interface: "fa5" + - description: "" + interface: "fa6" + - description: "" + interface: "fa7" + - description: "Camera" + interface: "fa8" + - description: "Camera" + interface: "fa9" + - description: "Camera" + interface: "fa10" + - description: "" + interface: "fa11" + - description: "Socket_7/2" + interface: "fa12" + - description: "Socket_7/4" + interface: "fa13" + - description: "Socket_7/8" + interface: "fa14" + - description: "" + interface: "fa15" + - description: "" + interface: "fa16" + - description: "" + interface: "fa17" + - description: "" + interface: "fa18" + - description: "" + interface: "fa19" + - description: "" + interface: "fa20" + - description: "" + interface: "fa21" + - description: "" + interface: "fa22" + - description: "AP" + interface: "fa23" + - description: "AP" + interface: "fa24" + - description: "" + interface: "gi1" + - description: "" + interface: "gi2" + - description: "" + interface: "gi3" + - description: "Eltex2124-8 - gi1/0/5" + interface: "gi4" + - description: "" + interface: "Po1" + - description: "" + interface: "Po2" + - description: "" + interface: "Po3" + - description: "" + interface: "Po4" + - description: "" + interface: "Po5" + - description: "" + interface: "Po6" + - description: "" + interface: "Po7" + - description: "" + interface: "Po8"