From dd54cfcccb39ffa7d34479ce2245497e9d8b5cec Mon Sep 17 00:00:00 2001 From: evilmonkey19 Date: Tue, 30 Jul 2024 13:49:18 +0200 Subject: [PATCH 1/2] Added template for Huawei SmartAX: display ont snmp-profile 0 all --- ...huawei_smartax_display_ont_snmp-profile_0_all.textfsm | 9 +++++++++ ntc_templates/templates/index | 1 + .../huawei_smartax_display_ont_snmp-profile_0_all.raw | 5 +++++ .../huawei_smartax_display_ont_snmp-profile_0_all.yml | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm create mode 100644 tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw create mode 100644 tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.yml diff --git a/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm b/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm new file mode 100644 index 0000000000..fc41901d51 --- /dev/null +++ b/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm @@ -0,0 +1,9 @@ +Value ONT_ID (\d+) +Value SNMP_PROFILE_ID (\d+) +Value SNMP_PROFILE_NAME (\S+) + +Start + ^\s*ONT\s*ID\s*SNMP\s*profile\s*ID\s*SNMP\s*profile\s*name\s* + ^\s*${ONT_ID}\s*${SNMP_PROFILE_ID}\s*${SNMP_PROFILE_NAME} + ^\s* + ^. -> Error \ No newline at end of file diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index cc2538ee80..11740bbbca 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -636,6 +636,7 @@ hp_procurve_show_ip.textfsm, .*, hp_procurve, sh[[ow]] ip huawei_smartax_display_ont_info_summary_ont.textfsm:huawei_smartax_display_ont_info_summary_sn.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] su[[mmary]] \S+ *$ huawei_smartax_display_ont_info_0_1_2.textfsm:huawei_smartax_display_ont_info_description.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] (\d+\s*|\d+ \d+ \d+\s*) *$ huawei_smartax_display_ont_optical-info_0_all.textfsm, .*, huawei_smartax, di[[splay]] ont o[[ptical-info]] \d+ all +huawei_smartax_display_ont_snmp-profile_0_all.textfsm, .*, huawei_smartax, di[[splay]] ont s[[nmp-profile]] \d+ all huawei_smartax_display_sysman_service_state.textfsm, .*, huawei_smartax, di[[splay]] sysman s[[ervice]] s[[tate]] huawei_smartax_display_board_serial-number.textfsm, .*, huawei_smartax, di[[splay]] bo[[ard]] s[[erial-number]]\s* huawei_smartax_display_ont_autofind.textfsm, .*, huawei_smartax, di[[splay]] ont a[[utofind]]\s* diff --git a/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw new file mode 100644 index 0000000000..a344f28dbf --- /dev/null +++ b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw @@ -0,0 +1,5 @@ + -------------------------------------------------------------------- + ONT ID SNMP profile ID SNMP profile name + -------------------------------------------------------------------- + 1 1 snmp-profile_1 + -------------------------------------------------------------------- \ No newline at end of file diff --git a/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.yml b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.yml new file mode 100644 index 0000000000..87a523196b --- /dev/null +++ b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.yml @@ -0,0 +1,5 @@ +--- +parsed_sample: + - ont_id: "1" + snmp_profile_id: "1" + snmp_profile_name: "snmp-profile_1" From a3bf9ae5ab2b037452b41cf2961a104af77f72ef Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:24:47 -0400 Subject: [PATCH 2/2] Apply suggestions from code review --- .../huawei_smartax_display_ont_snmp-profile_0_all.textfsm | 2 +- .../huawei_smartax_display_ont_snmp-profile_0_all.raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm b/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm index fc41901d51..3c81aab171 100644 --- a/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm +++ b/ntc_templates/templates/huawei_smartax_display_ont_snmp-profile_0_all.textfsm @@ -6,4 +6,4 @@ Start ^\s*ONT\s*ID\s*SNMP\s*profile\s*ID\s*SNMP\s*profile\s*name\s* ^\s*${ONT_ID}\s*${SNMP_PROFILE_ID}\s*${SNMP_PROFILE_NAME} ^\s* - ^. -> Error \ No newline at end of file + ^. -> Error diff --git a/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw index a344f28dbf..09d2030749 100644 --- a/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw +++ b/tests/huawei_smartax/display_ont_snmp-profile_0_all/huawei_smartax_display_ont_snmp-profile_0_all.raw @@ -2,4 +2,4 @@ ONT ID SNMP profile ID SNMP profile name -------------------------------------------------------------------- 1 1 snmp-profile_1 - -------------------------------------------------------------------- \ No newline at end of file + --------------------------------------------------------------------