From 98fecbedd586635a4eec82e260ca3f2d10fbb6b6 Mon Sep 17 00:00:00 2001 From: eperpinya Date: Fri, 13 Dec 2024 11:52:00 +0100 Subject: [PATCH] Adding template for Alcatel AOS (only R8): `show interfaces alias` --- .../alcatel_aos_show_interfaces_alias.textfsm | 19 ++++++++++++++++++ ntc_templates/templates/index | 2 ++ .../alcatel_aos_show_interfaces_alias.raw | 7 +++++++ .../alcatel_aos_show_interfaces_alias.yml | 20 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 ntc_templates/templates/alcatel_aos_show_interfaces_alias.textfsm create mode 100644 tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.raw create mode 100644 tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.yml diff --git a/ntc_templates/templates/alcatel_aos_show_interfaces_alias.textfsm b/ntc_templates/templates/alcatel_aos_show_interfaces_alias.textfsm new file mode 100644 index 0000000000..3d4a303097 --- /dev/null +++ b/ntc_templates/templates/alcatel_aos_show_interfaces_alias.textfsm @@ -0,0 +1,19 @@ +Value PORT (\S+) +Value ADMIN_STATUS (\S+) +Value LINK_STATUS (\S+) +Value WAIT_TO_RESTORE (\d+) +Value WAIT_TO_SHUTDOWN (\d+) +Value ALIAS (.*) + +Start + ^\s*-+\+ -> Table + ^\s*Chas\/\s*$$ + ^\s*Slot\/\s+Admin\s+Link\s+WTR\s+WTS\s+Alias\s*$$ + ^\s*Port\s+Status\s+Status\s+\(sec\)\s+\(msec\)\s*$$ + ^\s*$$ + ^.*$$ -> Error + +Table + ^\s*${PORT}\s+${ADMIN_STATUS}\s+${LINK_STATUS}\s+${WAIT_TO_RESTORE}\s+${WAIT_TO_SHUTDOWN}\s+"${ALIAS}"\s*$$ -> Record + ^\s*$$ + ^.*$$ -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 46e4261900..fe158ecfd9 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -11,9 +11,11 @@ # 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_alias.textfsm, .*, alcatel_aos, sh[[ow]] in[[terfaces]] al[[ias]] 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]] diff --git a/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.raw b/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.raw new file mode 100644 index 0000000000..e40d66a8a6 --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.raw @@ -0,0 +1,7 @@ + Chas/ + Slot/ Admin Link WTR WTS Alias + Port Status Status (sec) (msec) +--------+----------+---------+----------+----------+----------------------- + 1/1/1 enable up 0 0 "This is an example" + 2/1/10 enable down 0 0 "This_is_an_example" + 2/1/11 enable down 0 0 "This" diff --git a/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.yml b/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.yml new file mode 100644 index 0000000000..8eaeb3c64d --- /dev/null +++ b/tests/alcatel_aos/show_interfaces_alias/alcatel_aos_show_interfaces_alias.yml @@ -0,0 +1,20 @@ +--- +parsed_sample: + - admin_status: "enable" + alias: "This is an example" + link_status: "up" + port: "1/1/1" + wait_to_restore: "0" + wait_to_shutdown: "0" + - admin_status: "enable" + alias: "This_is_an_example" + link_status: "down" + port: "2/1/10" + wait_to_restore: "0" + wait_to_shutdown: "0" + - admin_status: "enable" + alias: "This" + link_status: "down" + port: "2/1/11" + wait_to_restore: "0" + wait_to_shutdown: "0"