From fded2cb521002d835b79b94f6fb02d945a505dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Mon, 9 Dec 2024 15:49:37 +0100 Subject: [PATCH] New Template Alcatel AOS: `show interfaces status` (#1909) Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com> --- ...alcatel_aos_show_interfaces_status.textfsm | 31 ++ ntc_templates/templates/index | 1 + .../alcatel_aos_show_interfaces_status_R6.raw | 33 ++ .../alcatel_aos_show_interfaces_status_R6.yml | 392 ++++++++++++++++++ .../alcatel_aos_show_interfaces_status_R8.raw | 14 + .../alcatel_aos_show_interfaces_status_R8.yml | 152 +++++++ 6 files changed, 623 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_interfaces_status.textfsm create mode 100644 tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.raw create mode 100644 tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.yml create mode 100644 tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.raw create mode 100644 tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.yml diff --git a/ntc_templates/templates/alcatel_aos_show_interfaces_status.textfsm b/ntc_templates/templates/alcatel_aos_show_interfaces_status.textfsm new file mode 100644 index 0000000000..dbb070b69f --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_interfaces_status.textfsm @@ -0,0 +1,31 @@ +Value PORT ((\d+\/?)+) +Value ADMIN_STATUS (\S+) +Value AUTO_NEGOTIATION (\S+) +Value DETECTED_SPEED (\d+) +Value DETECTED_DUPLEX (\S+) +Value DETECTED_HYBRID (\S+) +Value DETECTED_PAUSE (\S+) +Value DETECTED_FEC (\S+) +Value CONFIGURED_SPEED (\S+) +Value CONFIGURED_DUPLEX (\S+) +Value CONFIGURED_HYBRID (\S+) +Value CONFIGURED_PAUSE (\S+) +Value CONFIGURED_FEC (\S+) +Value LINK_TRAP (\S+) +Value ENERGY_EFFICIENT_ETHERNET (\S+) + +Start + ^\s*-+\+ + ^\s*${PORT}\s+${AUTO_NEGOTIATION}\s*(-|${DETECTED_SPEED})\s*(-|${DETECTED_DUPLEX})\s*(-|${DETECTED_HYBRID})\s*${CONFIGURED_SPEED}\s*${CONFIGURED_DUPLEX}\s*${CONFIGURED_HYBRID}\s*(-|${LINK_TRAP})\s*$$ -> Record + ^\s*${PORT}\s+${ADMIN_STATUS}\s+${AUTO_NEGOTIATION}\s+(-|${DETECTED_SPEED})\s+(-|${DETECTED_DUPLEX})\s+(-|${DETECTED_PAUSE})\s+(-|${DETECTED_FEC})\s+${CONFIGURED_SPEED}\s+${CONFIGURED_DUPLEX}\s+(-|${CONFIGURED_PAUSE})\s+${CONFIGURED_FEC}\s+(-|${LINK_TRAP})\s+${ENERGY_EFFICIENT_ETHERNET}\s*$$ -> Record + ^\s*(Chas/\s+)?DETECTED(-VALUES)?\s+CONFIGURED(-VALUES)?\s*$$ + # R6 version + ^\s*Slot/\s+AutoNego\s+Speed\s+Duplex\s+Hybrid\s+Speed\s+Duplex\s+Hybrid\s+Trap\s*$$ + ^\s*(\S+\s+\(Mbps\)\s+)+Mode\s+LinkUpDown\s*$$ + # R8 version + ^\s*Slot/\s+Admin\s+Auto\s+Speed\s+Duplex\s+Pause\s+FEC\s+Speed\s+Duplex\s+Pause\s+FEC\s+Link\s*$$ + ^\s*Port\s+Status\s+(\S+\s+\(Mbps\)\s+)+Cfg\s+Trap\s+EEE\s*$$ + # + ^\s*F[A-Z]\s+-\s+Forced + ^\s*$$ + ^.*$$ -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index f88cf397f7..b0886b39d3 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -11,6 +11,7 @@ # Template, Hostname, Platform, Command +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_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]]) diff --git a/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.raw b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.raw new file mode 100644 index 0000000000..9b92fb208e --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.raw @@ -0,0 +1,33 @@ + DETECTED CONFIGURED +Slot/ AutoNego Speed Duplex Hybrid Speed Duplex Hybrid Trap +Port (Mbps) Type (Mbps) Mode LinkUpDown +-----+--------+------+------+------+--------+------+------+------ + 1/1 Enable 1000 Full NA Auto Auto NA - + 1/2 Enable - - - Auto Auto NA - + 1/3 Enable - - - Auto Auto NA - + 1/4 Enable - - - Auto Auto NA - + 1/5 Enable - - - Auto Auto NA - + 1/6 Enable - - - Auto Auto NA - + 1/7 Enable - - - Auto Auto NA - + 1/8 Enable - - - Auto Auto NA - + 1/9 Enable - - - Auto Auto NA - + 1/10 Enable - - - Auto Auto NA - + 1/11 Enable - - - Auto Auto NA - + 1/12 Enable - - - Auto Auto NA - + 1/13 Enable - - - Auto Auto NA - + 1/14 Enable - - - Auto Auto NA - + 1/15 Enable - - - Auto Auto NA - + 1/16 Enable - - - Auto Auto NA - + 1/17 Enable - - - Auto Auto NA - + 1/18 Enable - - - Auto Auto NA - + 1/19 Enable - - - Auto Auto NA - + 1/20 Enable - - - Auto Auto NA - + 1/21 Enable - - - Auto Auto NA - + 1/22 Enable - - - Auto Auto NA - + 1/23 Enable - - - Auto Auto NA - + 1/24 Enable - - - Auto Auto NA - + 1/25 Enable 1000 Full NA 1000 Full NA - + 1/26 Enable - - - 1000 Full NA - + +FF - ForcedFiber PF - PreferredFiber F - Fiber +FC - ForcedCopper PC - PreferredCopper C - Copper diff --git a/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.yml b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.yml new file mode 100644 index 0000000000..d6df9871e3 --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R6.yml @@ -0,0 +1,392 @@ +--- +parsed_sample: + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "Full" + detected_fec: "" + detected_hybrid: "NA" + detected_pause: "" + detected_speed: "1000" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/1" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/2" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/3" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/4" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/5" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/6" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/7" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/8" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/9" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/10" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/11" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/12" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/13" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/14" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/15" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/16" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/17" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/18" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/19" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/20" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/21" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/22" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/23" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Auto" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "Auto" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/24" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Full" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "1000" + detected_duplex: "Full" + detected_fec: "" + detected_hybrid: "NA" + detected_pause: "" + detected_speed: "1000" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/25" + - admin_status: "" + auto_negotiation: "Enable" + configured_duplex: "Full" + configured_fec: "" + configured_hybrid: "NA" + configured_pause: "" + configured_speed: "1000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "" + link_trap: "" + port: "1/26" diff --git a/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.raw b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.raw new file mode 100644 index 0000000000..8402568d6a --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.raw @@ -0,0 +1,14 @@ + Chas/ DETECTED-VALUES CONFIGURED-VALUES + Slot/ Admin Auto Speed Duplex Pause FEC Speed Duplex Pause FEC Link + Port Status Nego (Mbps) Det (Mbps) Cfg Trap EEE +--------+------+----+--------+------+-------+----+--------+------+-------+-----+-----+--- + 1/1/1 en en 1000 Full - DIS 10000 Full - AUTO en dis + 1/1/2 en dis - - - - 10000 Full - AUTO en dis + 1/1/3 en en 1000 Full - DIS 10000 Full - AUTO en dis + 1/1/4 en dis - - - - 10000 Full - AUTO en dis + 1/1/5 en dis - - - - 10000 Full - AUTO en dis + 1/1/6 en dis - - - - 10000 Full - AUTO en dis + 1/1/7 en dis - - - - 10000 Full - AUTO en dis + 1/1/8 en dis - - - - 10000 Full - AUTO en dis + 1/1/9 en dis - - - - 20000 Full - AUTO en dis + 1/1/10 dis dis - - - - 20000 Full - AUTO en dis diff --git a/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.yml b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.yml new file mode 100644 index 0000000000..ab23f7824d --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_status/alcatel_aos_show_interfaces_status_R8.yml @@ -0,0 +1,152 @@ +--- +parsed_sample: + - admin_status: "en" + auto_negotiation: "en" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "Full" + detected_fec: "DIS" + detected_hybrid: "" + detected_pause: "" + detected_speed: "1000" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/1" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/2" + - admin_status: "en" + auto_negotiation: "en" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "Full" + detected_fec: "DIS" + detected_hybrid: "" + detected_pause: "" + detected_speed: "1000" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/3" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/4" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/5" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/6" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/7" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "10000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/8" + - admin_status: "en" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "20000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/9" + - admin_status: "dis" + auto_negotiation: "dis" + configured_duplex: "Full" + configured_fec: "AUTO" + configured_hybrid: "" + configured_pause: "" + configured_speed: "20000" + detected_duplex: "" + detected_fec: "" + detected_hybrid: "" + detected_pause: "" + detected_speed: "" + energy_efficient_ethernet: "dis" + link_trap: "en" + port: "1/1/10"