From 7fcccf088cb87aace526e17aa491d338310dc916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Wed, 11 Dec 2024 16:24:01 +0100 Subject: [PATCH] Added template for Alcatel AOS: `show interfaces port` (#1908) Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com> --- .../alcatel_aos_show_interfaces_port.textfsm | 25 ++++++ ntc_templates/templates/index | 1 + .../alcatel_aos_show_interfaces_port_R6.raw | 15 ++++ .../alcatel_aos_show_interfaces_port_R6.yml | 82 +++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_interfaces_port.textfsm create mode 100644 tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.raw create mode 100644 tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.yml diff --git a/ntc_templates/templates/alcatel_aos_show_interfaces_port.textfsm b/ntc_templates/templates/alcatel_aos_show_interfaces_port.textfsm new file mode 100644 index 0000000000..70e30f49f9 --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_interfaces_port.textfsm @@ -0,0 +1,25 @@ +Value PORT (\S+) +Value PERMANENT_SHUTDOWN (\*?) +Value ADMIN_STATUS (\S+) +Value LINK_STATUS (\S+) +Value VIOLATIONS (\S+) +Value RECOVERY_TIME (\d+) +Value RECOVERY_MAX (\d+) +Value WTR_RUNNING (\#?) +Value WTR_TIME (\d+) +Value ALIAS (.*) + +Start + ^\s*-+\+ -> Table + ^Legends: WTR - Wait To Restore + ^\s+# + ^\s+\* + ^\s*Slot/\s+Admin\s+Link\s+Violations\s+Recovery\s+Recovery\s+WTR\s+Alias\s*$$ + ^\s*Port\s+Status\s+Status\s+Time\s+Max\s+\(sec\)\s*$$ + ^\s*$$ + ^.*$$ -> Error + +Table + ^\s*${PERMANENT_SHUTDOWN}${PORT}\s+${ADMIN_STATUS}\s+${LINK_STATUS}\s+${VIOLATIONS}\s+${RECOVERY_TIME}\s+${RECOVERY_MAX}\s+(?:${WTR_RUNNING}\s+)?${WTR_TIME}\s+"${ALIAS}"\s*$$ -> Record + ^\s*$$ + ^.*$$ -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 87419b3a9c..753f733f8e 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -14,6 +14,7 @@ Template, Hostname, Platform, Command alcatel_aos_show_lldp_remote-system.textfsm, .*, alcatel_aos, sh[[ow]] lldp r[[emote-system]] alcatel_aos_show_interfaces_status.textfsm, .*, alcatel_aos, sh[[ow]] in[[terfaces]] st[[atus]] alcatel_aos_show_mac-address-table.textfsm, .*, alcatel_aos, sh[[ow]] mac-(a[[ddress-table]]|l[[earning]]) +alcatel_aos_show_interfaces_port.textfsm, .*, alcatel_aos, sh[[ow]] in[[terfaces]] p[[ort]] alcatel_aos_show_port-security.textfsm, .*, alcatel_aos, sh[[ow]] port-[[security]] alcatel_aos_show_vlan_port.textfsm, .*, alcatel_aos, sh[[ow]] vl[[an]] (p[[ort]]|m[[embers]]) alcatel_aos_show_chassis.textfsm, .*, alcatel_aos, sh[[ow]] ch[[assis]] diff --git a/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.raw b/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.raw new file mode 100644 index 0000000000..a0e26aed65 --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.raw @@ -0,0 +1,15 @@ +Legends: WTR - Wait To Restore + # - WTR Timer is Running & Port is in wait-to-restore state + * - Permanent Shutdown + +Slot/ Admin Link Violations Recovery Recovery WTR Alias +Port Status Status Time Max (sec) +------+----------+---------+----------+----------+----------+----------+----------------------------------------- + *1/1 enable up none 300 10 0 "Hello" + 1/2 enable down none 300 10 0 "" + 1/11 enable down none 300 10 # 10 "" + 1/17 disable down none 300 10 0 "" + 1/23 disable down none 300 10 0 "" + 1/25 enable up none 300 10 0 "" + 1/26 enable down none 300 10 0 "" + 1/28 enable down none 0 0 0 "" diff --git a/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.yml b/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.yml new file mode 100644 index 0000000000..ce2ae5bc42 --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_port/alcatel_aos_show_interfaces_port_R6.yml @@ -0,0 +1,82 @@ +--- +parsed_sample: + - admin_status: "enable" + alias: "Hello" + link_status: "up" + permanent_shutdown: "*" + port: "1/1" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "enable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/2" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "enable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/11" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "#" + wtr_time: "10" + - admin_status: "disable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/17" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "disable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/23" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "enable" + alias: "" + link_status: "up" + permanent_shutdown: "" + port: "1/25" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "enable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/26" + recovery_max: "10" + recovery_time: "300" + violations: "none" + wtr_running: "" + wtr_time: "0" + - admin_status: "enable" + alias: "" + link_status: "down" + permanent_shutdown: "" + port: "1/28" + recovery_max: "0" + recovery_time: "0" + violations: "none" + wtr_running: "" + wtr_time: "0"