From 1af05079c96477066f7113d42b84a77409d17a6c Mon Sep 17 00:00:00 2001 From: PavloSkliarenko <78343937+PavloSkliarenko@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:12:15 +0400 Subject: [PATCH] HP Comware 'display interface' template fix (#1528) * Add untagged vlan parsing * Change untagged vlan value name --- ntc_templates/templates/hp_comware_display_interface.textfsm | 2 ++ .../display_interface/hp_comware_display_interface.yml | 4 ++++ .../display_interface/hp_comware_display_interface1.yml | 1 + .../display_interface/hp_comware_display_interface2.yml | 3 +++ .../display_interface/hp_comware_display_interface3.yml | 1 + .../display_interface/hp_comware_display_interface4.yml | 2 ++ .../display_interface/hp_comware_display_interface5.yml | 1 + .../display_interface/hp_comware_display_interface6.yml | 1 + .../display_interface/hp_comware_display_interface7.yml | 1 + .../display_interface/hp_comware_display_interface8.yml | 3 +++ .../display_interface/hp_comware_display_interface9.yml | 2 ++ 11 files changed, 21 insertions(+) diff --git a/ntc_templates/templates/hp_comware_display_interface.textfsm b/ntc_templates/templates/hp_comware_display_interface.textfsm index accc734a78..6a06f3273e 100644 --- a/ntc_templates/templates/hp_comware_display_interface.textfsm +++ b/ntc_templates/templates/hp_comware_display_interface.textfsm @@ -10,6 +10,7 @@ Value BANDWIDTH (.*) Value DUPLEX (\S+) Value SPEED (\S+) Value PORT_LINK_TYPE (\S+) +Value UNTAGGED_VLAN_ID (\d+) Value VLAN_NATIVE (\d+) Value List VLAN_PASSING ([^,]+) Value List VLAN_PERMITTED ([^,]+) @@ -37,6 +38,7 @@ Start ^\s*${SPEED},\s+${DUPLEX},\s+link\s+type ^\s*PVID:\s+${VLAN_NATIVE} ^\s*Port\s+link-type:\s+${PORT_LINK_TYPE} + ^\s*Un[Tt]agged\s+VLAN\s+ID\s*:\s*${UNTAGGED_VLAN_ID} # Trunk - Passing VLANs (parsing multiple times with Continue) ^\s+VLAN\s+[Pp]assing\s*:\s+${VLAN_PASSING},* -> Continue # Skip initial VLANs and read the Nth + 1 diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface.yml b/tests/hp_comware/display_interface/hp_comware_display_interface.yml index 265ec1391a..d524930322 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface.yml @@ -15,6 +15,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] @@ -31,6 +32,7 @@ parsed_sample: port_link_type: "Trunk" protocol_status: "UP" speed: "40Gbps-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: - "1(default vlan)" @@ -53,6 +55,7 @@ parsed_sample: port_link_type: "Trunk" protocol_status: "DOWN" speed: "Unknown-speed" + untagged_vlan_id: "" vlan_native: "2190" vlan_passing: - "2000" @@ -74,6 +77,7 @@ parsed_sample: port_link_type: "Access" protocol_status: "DOWN" speed: "Unknown-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface1.yml b/tests/hp_comware/display_interface/hp_comware_display_interface1.yml index 64d8a4dae6..de09338d8e 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface1.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface1.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "Trunk" protocol_status: "" speed: "160Gbps-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: - "2-21" diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface2.yml b/tests/hp_comware/display_interface/hp_comware_display_interface2.yml index c5978dd26d..57c051e05f 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface2.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface2.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "Access" protocol_status: "DOWN" speed: "Unknown-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: [] vlan_permitted: [] @@ -28,6 +29,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP(spoofing)" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] @@ -45,6 +47,7 @@ parsed_sample: port_link_type: "" protocol_status: "DOWN" speed: "Unknown-speed" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface3.yml b/tests/hp_comware/display_interface/hp_comware_display_interface3.yml index 385ccf066a..04fae527d5 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface3.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface3.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "Trunk" protocol_status: "" speed: "20Gbps-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: - "1(default vlan)" diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface4.yml b/tests/hp_comware/display_interface/hp_comware_display_interface4.yml index 95d99743a0..3aaeccc961 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface4.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface4.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "trunk" protocol_status: "" speed: "20Gbps-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: - "1(default vlan)" @@ -36,6 +37,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface5.yml b/tests/hp_comware/display_interface/hp_comware_display_interface5.yml index be413c145d..acec875d20 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface5.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface5.yml @@ -14,6 +14,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "1000Mb/s" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface6.yml b/tests/hp_comware/display_interface/hp_comware_display_interface6.yml index 016563431e..12c464b637 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface6.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface6.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "access" protocol_status: "" speed: "10Gbps-speed" + untagged_vlan_id: "1" vlan_native: "1" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface7.yml b/tests/hp_comware/display_interface/hp_comware_display_interface7.yml index 8237423155..beddd75f41 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface7.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface7.yml @@ -13,6 +13,7 @@ parsed_sample: port_link_type: "Trunk" protocol_status: "UP" speed: "1000Mbps-speed" + untagged_vlan_id: "" vlan_native: "1" vlan_passing: - "4050" diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface8.yml b/tests/hp_comware/display_interface/hp_comware_display_interface8.yml index fbf3d26575..baf98008e2 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface8.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface8.yml @@ -12,6 +12,7 @@ parsed_sample: port_link_type: "" protocol_status: "" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] @@ -30,6 +31,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "1000Mbps-speed" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] @@ -46,6 +48,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] diff --git a/tests/hp_comware/display_interface/hp_comware_display_interface9.yml b/tests/hp_comware/display_interface/hp_comware_display_interface9.yml index 03a18d0dad..cb36174850 100644 --- a/tests/hp_comware/display_interface/hp_comware_display_interface9.yml +++ b/tests/hp_comware/display_interface/hp_comware_display_interface9.yml @@ -14,6 +14,7 @@ parsed_sample: port_link_type: "" protocol_status: "DOWN" speed: "1000M" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: [] @@ -30,6 +31,7 @@ parsed_sample: port_link_type: "" protocol_status: "UP" speed: "" + untagged_vlan_id: "" vlan_native: "" vlan_passing: [] vlan_permitted: []