From 9a6d6c50862a2cd9a2382bdcf7e616e11107ee6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enric=20Perpiny=C3=A0=20Pitarch?= Date: Tue, 30 Jul 2024 15:19:24 +0200 Subject: [PATCH] Added template for Huawei SmartAX: display_ont_port_vlan_0_1_byvlan_0 (#1795) --- ...display_ont_port_vlan_0_1_byvlan_0.textfsm | 16 +++++++++++++++ ntc_templates/templates/index | 1 + ...tax_display_ont_port_vlan_0_1_byvlan_0.raw | 10 ++++++++++ ...tax_display_ont_port_vlan_0_1_byvlan_0.yml | 20 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 ntc_templates/templates/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm create mode 100644 tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.raw create mode 100644 tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.yml diff --git a/ntc_templates/templates/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm b/ntc_templates/templates/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm new file mode 100644 index 0000000000..1c12800e43 --- /dev/null +++ b/ntc_templates/templates/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm @@ -0,0 +1,16 @@ +Value C_VLAN (\d+) +Value C_PRI (\d+) +Value ETH_TYPE (\S+) +Value VLAN_TYPE (\S+) +Value PORT_TYPE (\S+) +Value PORT_ID (\d+) +Value S_VLAN (\d+) +Value S_PRI (\d+) +Value S_PRI_POLICY (\S+) + +Start + ^\s*C-VLAN\s*C-PRI\s*ETH-type\s*VLAN-type\s*Port\s*Port\s*S-VLAN\s*S-PRI\s* + ^\s*type\s*ID\s*POLICY + ^\s+${C_VLAN}\s+(-|${C_PRI})\s+${ETH_TYPE}\s+${VLAN_TYPE}\s+${PORT_TYPE}\s+${PORT_ID}\s+${S_VLAN}\s+(-|${S_PRI})\s*(-|${S_PRI_POLICY})\s* -> Record + ^\s* + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index cc2538ee80..69ecf07a3b 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -635,6 +635,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_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_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* diff --git a/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.raw b/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.raw new file mode 100644 index 0000000000..fcaf9ccac3 --- /dev/null +++ b/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.raw @@ -0,0 +1,10 @@ + -------------------------------------------------------------------- + C-VLAN C-PRI ETH-type VLAN-type Port Port S-VLAN S-PRI S-PRI + type ID POLICY + -------------------------------------------------------------------- + 100 - IPoE QINQ ETH 2 20 3 DSCP + 100 - 0x6321 QINQ ETH 4 70 - - + -------------------------------------------------------------------- + Notes: IPoE indicates IPv4-IPoE, * indicates transparent attribute of + the vlan, In the Ethernet encapsulation list, the hexadecimal digits + indicate the user-defined Ethernet encapsulation type diff --git a/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.yml b/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.yml new file mode 100644 index 0000000000..5348f729ed --- /dev/null +++ b/tests/huawei_smartax/display_ont_port_vlan_0_1_byvlan_0/huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.yml @@ -0,0 +1,20 @@ +--- +parsed_sample: + - c_pri: "" + c_vlan: "100" + eth_type: "IPoE" + port_id: "2" + port_type: "ETH" + s_pri: "3" + s_pri_policy: "DSCP" + s_vlan: "20" + vlan_type: "QINQ" + - c_pri: "" + c_vlan: "100" + eth_type: "0x6321" + port_id: "4" + port_type: "ETH" + s_pri: "" + s_pri_policy: "" + s_vlan: "70" + vlan_type: "QINQ"