From a13dc8a0cc5660bcdf07e28fb018d0590f474d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Wed, 11 Dec 2024 17:03:05 +0100 Subject: [PATCH] updating the templates to add multiple PON ports (#1930) --- ...wei_smartax_display_ont_info_0_1_2.textfsm | 18 +++++++------ .../huawei_smartax_display_ont_info_fsp_4.raw | 25 +++++++++++++++++++ .../huawei_smartax_display_ont_info_fsp_4.yml | 20 +++++++++++++++ 3 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.raw create mode 100644 tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.yml diff --git a/ntc_templates/templates/huawei_smartax_display_ont_info_0_1_2.textfsm b/ntc_templates/templates/huawei_smartax_display_ont_info_0_1_2.textfsm index a21b3c605d..83d9cf55fd 100644 --- a/ntc_templates/templates/huawei_smartax_display_ont_info_0_1_2.textfsm +++ b/ntc_templates/templates/huawei_smartax_display_ont_info_0_1_2.textfsm @@ -1,19 +1,21 @@ Value Required FSP (\w+\/\s\w+\/\w+) Value Key ONT_ID (\d+) -Value SERIAL_NUMBER (\w+) -Value CONTROL_FLAG (\w+) -Value RUN_STATE (\w*) -Value CONFIG_STATE (\w*) -Value MATCH_STATE (\w*) +Value SERIAL_NUMBER ([A-Z0-9]{16}) +Value CONTROL_FLAG (active|deactive|configuring) +Value RUN_STATE (online|offline) +Value CONFIG_STATE (normal|mismatch|failing|online|initial) +Value MATCH_STATE (initial|mismatch|match) Value PROTECT_SIDE (no|yes) Start ^\s+- ^\s+F\/S\/P\s+ONT\s+SN\s+Control\s+Run\s+Config\s+Match\s+Protect ^\s+ID\s+flag\s+state\s+state\s+state\s+side -> SNs + ^.\s*$$ -> Error SNs - ^\s*${FSP}\s*${ONT_ID}\s*${SERIAL_NUMBER}\s*${CONTROL_FLAG}\s*(${RUN_STATE}|-)\s*(${CONFIG_STATE}|-)\s*(${MATCH_STATE}|-)\s*${PROTECT_SIDE}\s* -> Record + ^\s*${FSP}\s*${ONT_ID}\s*${SERIAL_NUMBER}\s*${CONTROL_FLAG}\s*(-|${RUN_STATE})\s*(-|${CONFIG_STATE})\s*(-|${MATCH_STATE})\s*${PROTECT_SIDE}\s* -> Record ^\s*- - ^\s*F\/S\/P\s+(ONT|ONT-ID)\s+Description -> EOF - ^. -> Error \ No newline at end of file + ^\s*F\/S\/P\s+(ONT|ONT-ID)\s+Description + ^\s*$$ + ^.-> Error diff --git a/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.raw b/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.raw new file mode 100644 index 0000000000..4e31705351 --- /dev/null +++ b/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.raw @@ -0,0 +1,25 @@ + ----------------------------------------------------------------------------- + F/S/P ONT SN Control Run Config Match Protect + ID flag state state state side + ----------------------------------------------------------------------------- + 0/ 1/0 0 46VBSM4LFW7QLGAV active online normal match no + ------------------------------- ---------------------------------------------- + F/S/P ONT-ID Description + ----------------------------------------------------------------------------- + 0/ 1/0 0 The boiling consignment budgets. + ----------------------------------------------------------------------------- + In port 0/ 1/0, the total of ONTs are: 1, online: 1 + ----------------------------------------------------------------------------- + + ----------------------------------------------------------------------------- + F/S/P ONT SN Control Run Config Match Protect + ID flag state state state side + ----------------------------------------------------------------------------- + 0/ 1/2 0 1234567890ABCDEF active online normal match no + ----------------------------------------------------------------------------- + F/S/P ONT-ID Description + ----------------------------------------------------------------------------- + 0/ 1/2 0 ONT_NO_DESCRIPTION + ----------------------------------------------------------------------------- + In port 0/ 1/2 , the total of ONTs are: 1, online: 1 + ----------------------------------------------------------------------------- diff --git a/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.yml b/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.yml new file mode 100644 index 0000000000..f9f4a8109c --- /dev/null +++ b/tests/huawei_smartax/display_ont_info_0/huawei_smartax_display_ont_info_fsp_4.yml @@ -0,0 +1,20 @@ +--- +parsed_sample: + - config_state: "normal" + control_flag: "active" + description: "The boiling consignment budgets." + fsp: "0/ 1/0" + match_state: "match" + ont_id: "0" + protect_side: "no" + run_state: "online" + serial_number: "46VBSM4LFW7QLGAV" + - config_state: "normal" + control_flag: "active" + description: "The boiling consignment budgets." + fsp: "0/ 1/2" + match_state: "match" + ont_id: "0" + protect_side: "no" + run_state: "online" + serial_number: "1234567890ABCDEF"