From b25416a2e75a7c429e19cfb6be0441f19628284c Mon Sep 17 00:00:00 2001 From: eperpinya Date: Thu, 12 Dec 2024 11:12:51 +0100 Subject: [PATCH 1/5] New template for Alcatel AOS: `show linkagg port` --- .../alcatel_aos_show_linkagg_port.textfsm | 15 +++++++++++++++ ntc_templates/templates/index | 1 + .../alcatel_aos_show_linkagg_port_R8.raw | 5 +++++ .../alcatel_aos_show_linkagg_port_R8.yml | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm create mode 100644 tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw create mode 100644 tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml diff --git a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm new file mode 100644 index 0000000000..51d939c91d --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm @@ -0,0 +1,15 @@ +Value INTERFACE (\S+) +Value AGGREGATE_TYPE (\S+) +Value SNMP_ID (\d+) +Value STATUS (\S+) +Value AGGREGATE (\d+) +Value OPERATIONAL_STATUS (\S+) +Value LINK_STATUS (\S+) +Value PRIMARY (\S+) + +Start + ^\s*Chassis\/Slot\/Port\s*Aggregate\s*SNMP\s*Id\s*Status\s*Agg\s*Oper\s*Link\s*Prim\s*$$ + ^\s*-+ + ^\s*${INTERFACE}\s*${AGGREGATE_TYPE}\s*${SNMP_ID}\s*${STATUS}\s*${AGGREGATE}\s*${OPERATIONAL_STATUS}\s*${LINK_STATUS}\s*${PRIMARY}\s*$$ -> Record + ^\s*$$ + ^.*$$ -> Error \ No newline at end of file diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 4ef2222bd5..14b8297c8e 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -16,6 +16,7 @@ alcatel_aos_show_interfaces_status.textfsm, .*, alcatel_aos, sh[[ow]] in[[terfac 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_linkagg_port.textfsm, .*, alcatel_aos, sh[[ow]] li[[nkagg]] po[[rt]] 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]] alcatel_aos_show_system.textfsm, .*, alcatel_aos, sh[[ow]] sy[[stem]] diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw new file mode 100644 index 0000000000..a73593ea42 --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw @@ -0,0 +1,5 @@ + +Chassis/Slot/Port Aggregate SNMP Id Status Agg Oper Link Prim +-------------------+----------+--------+----------+----+-----+-----+---- + 1/1/20 Dynamic 1000 ATTACHED 2 UP UP NO + 1/1/21 Dynamic 1001 ATTACHED 2 UP UP YES diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml new file mode 100644 index 0000000000..c87d296df5 --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml @@ -0,0 +1,18 @@ +--- +parsed_sample: + - aggregate: "2" + aggregate_type: "Dynamic" + interface: "1/1/20" + link_status: "UP" + operational_status: "UP" + primary: "NO" + snmp_id: "1000" + status: "ATTACHED" + - aggregate: "2" + aggregate_type: "Dynamic" + interface: "1/1/21" + link_status: "UP" + operational_status: "UP" + primary: "YES" + snmp_id: "1001" + status: "ATTACHED" From c69b8a8b6075ac940fc300de21c3b679f4a597a7 Mon Sep 17 00:00:00 2001 From: eperpinya Date: Thu, 12 Dec 2024 11:46:45 +0100 Subject: [PATCH 2/5] Added support for R6 --- .../alcatel_aos_show_linkagg_port.textfsm | 2 +- .../alcatel_aos_show_linkagg_port_R6.raw | 7 ++++ .../alcatel_aos_show_linkagg_port_R6.yml | 34 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw create mode 100644 tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.yml diff --git a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm index 51d939c91d..44c69ee14d 100644 --- a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm @@ -8,7 +8,7 @@ Value LINK_STATUS (\S+) Value PRIMARY (\S+) Start - ^\s*Chassis\/Slot\/Port\s*Aggregate\s*SNMP\s*Id\s*Status\s*Agg\s*Oper\s*Link\s*Prim\s*$$ + ^\s*(?:Chassis\/)?Slot\/Port\s*Aggregate\s*SNMP\s*Id\s*Status\s*Agg\s*Oper\s*Link\s*Prim\s*$$ ^\s*-+ ^\s*${INTERFACE}\s*${AGGREGATE_TYPE}\s*${SNMP_ID}\s*${STATUS}\s*${AGGREGATE}\s*${OPERATIONAL_STATUS}\s*${LINK_STATUS}\s*${PRIMARY}\s*$$ -> Record ^\s*$$ diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw new file mode 100644 index 0000000000..7b88f0ad9b --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw @@ -0,0 +1,7 @@ + +Slot/Port Aggregate SNMP Id Status Agg Oper Link Prim +---------+---------+-------+----------+----+----+----+---- + 1/1 Dynamic 1000 ATTACHED 1 UP UP YES + 1/2 Dynamic 1001 ATTACHED 1 UP UP NO + 1/3 Dynamic 1002 ATTACHED 2 UP UP YES + 1/4 Dynamic 1003 ATTACHED 2 UP UP NO \ No newline at end of file diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.yml b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.yml new file mode 100644 index 0000000000..d93d53a282 --- /dev/null +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.yml @@ -0,0 +1,34 @@ +--- +parsed_sample: + - aggregate: "1" + aggregate_type: "Dynamic" + interface: "1/1" + link_status: "UP" + operational_status: "UP" + primary: "YES" + snmp_id: "1000" + status: "ATTACHED" + - aggregate: "1" + aggregate_type: "Dynamic" + interface: "1/2" + link_status: "UP" + operational_status: "UP" + primary: "NO" + snmp_id: "1001" + status: "ATTACHED" + - aggregate: "2" + aggregate_type: "Dynamic" + interface: "1/3" + link_status: "UP" + operational_status: "UP" + primary: "YES" + snmp_id: "1002" + status: "ATTACHED" + - aggregate: "2" + aggregate_type: "Dynamic" + interface: "1/4" + link_status: "UP" + operational_status: "UP" + primary: "NO" + snmp_id: "1003" + status: "ATTACHED" From 00be627b581bbebe104911218dcdf20aa363a4a9 Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:13:59 -0500 Subject: [PATCH 3/5] Apply suggestions from code review --- ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm | 2 +- .../show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm index 44c69ee14d..8aab07daa2 100644 --- a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm @@ -12,4 +12,4 @@ Start ^\s*-+ ^\s*${INTERFACE}\s*${AGGREGATE_TYPE}\s*${SNMP_ID}\s*${STATUS}\s*${AGGREGATE}\s*${OPERATIONAL_STATUS}\s*${LINK_STATUS}\s*${PRIMARY}\s*$$ -> Record ^\s*$$ - ^.*$$ -> Error \ No newline at end of file + ^.*$$ -> Error diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw index 7b88f0ad9b..b7278c9d94 100644 --- a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R6.raw @@ -4,4 +4,4 @@ Slot/Port Aggregate SNMP Id Status Agg Oper Link Prim 1/1 Dynamic 1000 ATTACHED 1 UP UP YES 1/2 Dynamic 1001 ATTACHED 1 UP UP NO 1/3 Dynamic 1002 ATTACHED 2 UP UP YES - 1/4 Dynamic 1003 ATTACHED 2 UP UP NO \ No newline at end of file + 1/4 Dynamic 1003 ATTACHED 2 UP UP NO From f46625620fbf4113fde0133fab52f0626a673abe Mon Sep 17 00:00:00 2001 From: eperpinya Date: Fri, 13 Dec 2024 13:36:36 +0100 Subject: [PATCH 4/5] Adding extra test data and adapting to this data --- .../templates/alcatel_aos_show_linkagg_port.textfsm | 2 +- .../alcatel_aos_show_linkagg_port_R8.raw | 3 ++- .../alcatel_aos_show_linkagg_port_R8.yml | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm index 8aab07daa2..1c38859938 100644 --- a/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm +++ b/ntc_templates/templates/alcatel_aos_show_linkagg_port.textfsm @@ -2,7 +2,7 @@ Value INTERFACE (\S+) Value AGGREGATE_TYPE (\S+) Value SNMP_ID (\d+) Value STATUS (\S+) -Value AGGREGATE (\d+) +Value AGGREGATE (\S+) Value OPERATIONAL_STATUS (\S+) Value LINK_STATUS (\S+) Value PRIMARY (\S+) diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw index a73593ea42..b26a6f56b6 100644 --- a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw @@ -2,4 +2,5 @@ Chassis/Slot/Port Aggregate SNMP Id Status Agg Oper Link Prim -------------------+----------+--------+----------+----+-----+-----+---- 1/1/20 Dynamic 1000 ATTACHED 2 UP UP NO - 1/1/21 Dynamic 1001 ATTACHED 2 UP UP YES + 1/1/16 Dynamic 1002 CONFIGURED NONE DOWN DOWN UNK + 1/1/21 Dynamic 1001 ATTACHED 2 UP UP YES \ No newline at end of file diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml index c87d296df5..09bd33c839 100644 --- a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.yml @@ -8,6 +8,14 @@ parsed_sample: primary: "NO" snmp_id: "1000" status: "ATTACHED" + - aggregate: "NONE" + aggregate_type: "Dynamic" + interface: "1/1/16" + link_status: "DOWN" + operational_status: "DOWN" + primary: "UNK" + snmp_id: "1002" + status: "CONFIGURED" - aggregate: "2" aggregate_type: "Dynamic" interface: "1/1/21" From 3f0d83b023df1322fd477af0f99b428b5a4caf4c Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:49:42 -0500 Subject: [PATCH 5/5] Update tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw --- .../show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw index b26a6f56b6..40110559db 100644 --- a/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw +++ b/tests/alcatel_aos/show_linkagg_port/alcatel_aos_show_linkagg_port_R8.raw @@ -3,4 +3,4 @@ Chassis/Slot/Port Aggregate SNMP Id Status Agg Oper Link Prim -------------------+----------+--------+----------+----+-----+-----+---- 1/1/20 Dynamic 1000 ATTACHED 2 UP UP NO 1/1/16 Dynamic 1002 CONFIGURED NONE DOWN DOWN UNK - 1/1/21 Dynamic 1001 ATTACHED 2 UP UP YES \ No newline at end of file + 1/1/21 Dynamic 1001 ATTACHED 2 UP UP YES