Skip to content

Commit

Permalink
Fix hp_comware_display_vlan_all with production outputs (networktocod…
Browse files Browse the repository at this point in the history
  • Loading branch information
dainok authored and cppmonkey committed Oct 25, 2023
1 parent d6a1af9 commit 14b6b08
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ntc_templates/templates/hp_comware_display_vlan_all.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.raw
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions tests/hp_comware/display_vlan_all/hp_comware_display_vlan_all1.yml
Original file line number Diff line number Diff line change
@@ -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: ""

0 comments on commit 14b6b08

Please sign in to comment.