From ab6a2bb697ca79b67221fbeaec657447e4716b88 Mon Sep 17 00:00:00 2001 From: eperpinya Date: Thu, 12 Dec 2024 10:56:50 +0100 Subject: [PATCH] Adding new command on Alcatel AOS: `show linkagg alias` --- .../alcatel_aos_show_linkagg_alias.textfsm | 16 ++++++++++++ ntc_templates/templates/index | 1 + .../alcatel_aos_show_linkagg_alias_R8.raw | 7 +++++ .../alcatel_aos_show_linkagg_alias_R8.yml | 26 +++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_linkagg_alias.textfsm create mode 100644 tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.raw create mode 100644 tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.yml diff --git a/ntc_templates/templates/alcatel_aos_show_linkagg_alias.textfsm b/ntc_templates/templates/alcatel_aos_show_linkagg_alias.textfsm new file mode 100644 index 0000000000..2f469176f3 --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_linkagg_alias.textfsm @@ -0,0 +1,16 @@ +Value NUMBER (\d+) +Value AGGREGATE (\S+) +Value SIZE (\d+) +Value ADMIN_STATE (\S+) +Value OPERATIONAL_STATE (\S+) +Value N_ATTACHED_PORTS (\d+) +Value N_POSSIBLE_PORTS (\d+) +Value NAME (\S.+\S) + +Start + ^\s*Admin\s*Oper\s*Att\/Sel\s*$$ + ^\s*Number\s+Aggregate\s+Size\s+state\s+state\s+Ports\s+Name\s*$$ + ^\s*-+ + ^\s*${NUMBER}\s+${AGGREGATE}\s+${SIZE}\s+${ADMIN_STATE}\s+${OPERATIONAL_STATE}\s+${N_ATTACHED_PORTS}\s+${N_POSSIBLE_PORTS}\s+${NAME}\s*$$ -> Record + ^\s*$$ + ^.*$$ -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 4ef2222bd5..2b9949ff77 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -15,6 +15,7 @@ alcatel_aos_show_lldp_remote-system.textfsm, .*, alcatel_aos, sh[[ow]] lldp r[[e 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_linkagg_alias.textfsm, .*, alcatel_aos, sh[[ow]] li[[nkagg]] al[[ias]] 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_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.raw b/tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.raw new file mode 100644 index 0000000000..ee49c52987 --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.raw @@ -0,0 +1,7 @@ + + Admin Oper Att/Sel +Number Aggregate Size state state Ports Name +-------+----------+----+------------+-------+---------+-------------- + 2 Dynamic 2 ENABLED UP 2 2 LINK_LACP_CORE + 31 Dynamic 8 ENABLED DOWN 0 0 Created by Auto-Fabric on Mon Oct 6 00:00:00 2000 + 32 Dynamic 8 ENABLED DOWN 0 0 Created by Auto-Fabric on Mon Oct 01 00:00:00 2000 diff --git a/tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.yml b/tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.yml new file mode 100644 index 0000000000..ebb556fadb --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_alias/alcatel_aos_show_linkagg_alias_R8.yml @@ -0,0 +1,26 @@ +--- +parsed_sample: + - admin_state: "ENABLED" + aggregate: "Dynamic" + n_attached_ports: "2" + n_possible_ports: "2" + name: "LINK_LACP_CORE" + number: "2" + operational_state: "UP" + size: "2" + - admin_state: "ENABLED" + aggregate: "Dynamic" + n_attached_ports: "0" + n_possible_ports: "0" + name: "Created by Auto-Fabric on Mon Oct 6 00:00:00 2000" + number: "31" + operational_state: "DOWN" + size: "8" + - admin_state: "ENABLED" + aggregate: "Dynamic" + n_attached_ports: "0" + n_possible_ports: "0" + name: "Created by Auto-Fabric on Mon Oct 01 00:00:00 2000" + number: "32" + operational_state: "DOWN" + size: "8"