From 14b6b08e2212454e7f45bd6a08461f2d7b45ec7a Mon Sep 17 00:00:00 2001 From: Andrea Dainese Date: Wed, 29 Mar 2023 19:58:59 +0200 Subject: [PATCH] Fix hp_comware_display_vlan_all with production outputs (#1339) --- .../hp_comware_display_vlan_all.textfsm | 13 ++++++----- .../hp_comware_display_vlan_all1.raw | 23 +++++++++++++++++++ .../hp_comware_display_vlan_all1.yml | 16 +++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.raw create mode 100644 tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.yml diff --git a/ntc_templates/templates/hp_comware_display_vlan_all.textfsm b/ntc_templates/templates/hp_comware_display_vlan_all.textfsm index 5417d01a06..f18afc3486 100644 --- a/ntc_templates/templates/hp_comware_display_vlan_all.textfsm +++ b/ntc_templates/templates/hp_comware_display_vlan_all.textfsm @@ -9,14 +9,15 @@ Value IPV4_SUBNET (\S+) Start ^\s*VLAN\s+ID\s*: -> Continue.Record ^\s*VLAN\s+ID\s*:\s*${VLAN_ID} - ^\s*VLAN\s+type\s*:\s*${TYPE} - ^\s*Route\s+interface\s*:\s*${ROUTE_INTERFACE} - ^\s*IPv4\s+address\s*:\s*${IPV4_ADDRESS} - ^\s*IPv4\s+subnet\s+mask\s*:\s*${IPV4_SUBNET} + ^\s*VLAN\s+[Tt]ype\s*:\s*${TYPE} + ^\s*Route\s+[Ii]nterface\s*:\s*${ROUTE_INTERFACE} + ^\s*IPv4\s+[Aa]ddress\s*:\s*${IPV4_ADDRESS} + ^\s*IPv4\s+[Ss]ubnet\s+mask\s*:\s*${IPV4_SUBNET} ^\s*Description\s*:\s*${DESCRIPTION} ^\s*Name\s*:\s*${NAME} - ^\s*Tagged\sports - ^\s*Untagged\sports + ^\s*Tagged\s+[Pp]orts + ^\s*Untagged\s+[Pp]orts ^\s{3,}\S+\s*$$ ^\s{3,}\S+\s+\S+\s*$$ + ^\s{3,}\S+\s+\S+\s+\S+\s*$$ ^. -> Error diff --git a/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.raw b/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.raw new file mode 100644 index 0000000000..78b9bc7709 --- /dev/null +++ b/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.raw @@ -0,0 +1,23 @@ + VLAN ID: 1 + VLAN Type: static + Route Interface: not configured + Description: VLAN 0001 + Name: VLAN 0001 + Tagged Ports: none + Untagged Ports: + Bridge-Aggregation1 + GigabitEthernet1/0/25 GigabitEthernet1/0/26 GigabitEthernet1/0/27 + GigabitEthernet1/0/28 + + VLAN ID: 1002 + VLAN Type: static + Route Interface: not configured + Description: VLAN 1002 + Name: VLAN 1002 + Tagged Ports: + Bridge-Aggregation1 + Ten-GigabitEthernet1/0/29 + Ten-GigabitEthernet1/0/30 + Untagged Ports: + GigabitEthernet1/0/1 GigabitEthernet1/0/2 GigabitEthernet1/0/3 + GigabitEthernet1/0/4 GigabitEthernet1/0/5 GigabitEthernet1/0/6 diff --git a/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.yml b/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.yml new file mode 100644 index 0000000000..78d5c9dd82 --- /dev/null +++ b/tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.yml @@ -0,0 +1,16 @@ +--- +parsed_sample: + - vlan_id: "1" + name: "VLAN 0001" + description: "VLAN 0001" + type: "static" + route_interface: "not configured" + ipv4_address: "" + ipv4_subnet: "" + - vlan_id: "1002" + name: "VLAN 1002" + description: "VLAN 1002" + type: "static" + route_interface: "not configured" + ipv4_address: "" + ipv4_subnet: ""