From 3dcf455533bcad87d35af16e09cb41edbc44914c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Tue, 30 Jul 2024 15:34:01 +0200 Subject: [PATCH] Added template huawei_smartax: display_ont_gemport_0_ontid_0.textfsm (#1794) --- ..._smartax_display_ont_gemport_0_ontid_0.textfsm | 15 +++++++++++++++ ntc_templates/templates/index | 1 + ...awei_smartax_display_ont_gemport_0_ontid_0.raw | 11 +++++++++++ ...awei_smartax_display_ont_gemport_0_ontid_0.yml | 9 +++++++++ 4 files changed, 36 insertions(+) create mode 100644 ntc_templates/templates/huawei_smartax_display_ont_gemport_0_ontid_0.textfsm create mode 100644 tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.raw create mode 100644 tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.yml diff --git a/ntc_templates/templates/huawei_smartax_display_ont_gemport_0_ontid_0.textfsm b/ntc_templates/templates/huawei_smartax_display_ont_gemport_0_ontid_0.textfsm new file mode 100644 index 0000000000..a941f6f40d --- /dev/null +++ b/ntc_templates/templates/huawei_smartax_display_ont_gemport_0_ontid_0.textfsm @@ -0,0 +1,15 @@ +Value Key GEM_PORT (\d+) +Value T_CONT_ID (\d+) +Value SERVICE_TYPE (\S+) +Value ENCRYPT (\S+) +Value UPSTREAM_PQ (\S+) +Value DOWNSTREAM_PQ (\S+) +Value TRAFFIC_TABLE_INDEX (\S+) + +Start + ^\s*GEM\s*port\s*T-CONT\s*Service\s*Encrypt\s*Up\s*Down\s*Traffic\s* + ^\s*ID\s*ID\s*type\s*PQ\s*PQ\s*table\s*index + ^\s+${GEM_PORT}\s+${T_CONT_ID}\s+${SERVICE_TYPE}\s+${ENCRYPT}\s+(-|${UPSTREAM_PQ})\s+(-|${DOWNSTREAM_PQ})\s+(-|${TRAFFIC_TABLE_INDEX}) -> Record + ^\s*The\s*number\s*of\s*GEM\s*ports\s*is:\s*\d+ + ^\s* + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 07be864f3a..a359449c68 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -636,6 +636,7 @@ huawei_smartax_display_ont_info_summary_ont.textfsm:huawei_smartax_display_ont_i 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_port_vlan_0_1_byvlan_0.textfsm, .*, huawei_smartax, di[[splay]] ont p[[ort]] v[[lan]] \d+ \d+ byvlan \d+ huawei_smartax_display_ont_optical-info_0_all.textfsm, .*, huawei_smartax, di[[splay]] ont o[[ptical-info]] \d+ all +huawei_smartax_display_ont_gemport_0_ontid_0.textfsm, .*, huawei_smartax, di[[splay]] ont g[[emport]] \d+ ontid \d+\s* 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_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.raw b/tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.raw new file mode 100644 index 0000000000..6c440b2af4 --- /dev/null +++ b/tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.raw @@ -0,0 +1,11 @@ + F/S/P: 0/0/0 ONT ID: 5 + ------------------------------------------------------------------------------ + GEM port T-CONT Service Encrypt Up Down Traffic + ID ID type PQ PQ table index + ------------------------------------------------------------------------------ + 126 4 ETHERNET off - adapt - + ------------------------------------------------------------------------------ + Notes: Run the display traffic table ip command to query + traffic table configuration + ------------------------------------------------------------------------------ + The number of GEM ports is: 1 diff --git a/tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.yml b/tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.yml new file mode 100644 index 0000000000..d1f17e8780 --- /dev/null +++ b/tests/huawei_smartax/display_ont_gemport_0_ontid_0/huawei_smartax_display_ont_gemport_0_ontid_0.yml @@ -0,0 +1,9 @@ +--- +parsed_sample: + - downstream_pq: "adapt" + encrypt: "off" + gem_port: "126" + service_type: "ETHERNET" + t_cont_id: "4" + traffic_table_index: "" + upstream_pq: ""