From b644e1eda61e8cd0ae23c4d471b00afc6e21b707 Mon Sep 17 00:00:00 2001 From: Andrea Dainese Date: Sun, 26 Mar 2023 08:44:31 +0000 Subject: [PATCH] Fix hp_comware_display_vlan_all with production outputs --- .../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: ""