Skip to content

Commit 494c9a5

Browse files
committed
Normalize huawei_vrp pvid >> vlan_id
1 parent 823bec4 commit 494c9a5

12 files changed

+197
-197
lines changed

ntc_templates/templates/huawei_vrp_display_interface.textfsm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Value PROTOCOL_STATUS (\S*|\S*\s+\(\w+\))
44
Value INTERFACE_DESCRIPTION (.*)
55
Value LINK_TYPE (\S+)
66
Value PORT_TYPE (\S*)
7-
Value PVID (\d+)
7+
Value VLAN_ID (\d+)
88
Value TPID (\S+)
99
Value MTU (\d+)
1010
Value HOLD_TIMER (\d+)
@@ -30,9 +30,9 @@ Start
3030
^Description:${INTERFACE_DESCRIPTION}\s*$$
3131
^${PORT_TYPE}\s+Port,\s*Link-type\s*:\s*${LINK_TYPE},\s*$$
3232
^${PORT_TYPE}\s+Port,\s*The\s+(MTU|Maximum\s+Transmit\s+Unit)\s+is\s+${MTU}(,\s*Hold\s*timer\s*is\s*${HOLD_TIMER}\(sec\))?\s*$$
33-
^${PORT_TYPE}\s+Port,(\s*PVID\s*:\s*${PVID},)?\s*TPID\s*:\s*${TPID},\s*The\s*Maximum\s*(Frame\s*Length|Transmit\s*Unit)\s*is\s*${MTU}\s*$$
33+
^${PORT_TYPE}\s+Port,(\s*PVID\s*:\s*${VLAN_ID},)?\s*TPID\s*:\s*${TPID},\s*The\s*Maximum\s*(Frame\s*Length|Transmit\s*Unit)\s*is\s*${MTU}\s*$$
3434
^TPID\s*:\s*${TPID},\s*The\s*Maximum\s*Frame\s*Length\s*is\s*${MTU}\s*$$
35-
^PVID\s*:\s+${PVID},(\s*[^,]+,){0,}\s+The\s+Maximum\s+Frame\s+Length\s+is\s+${MTU}
35+
^PVID\s*:\s+${VLAN_ID},(\s*[^,]+,){0,}\s+The\s+Maximum\s+Frame\s+Length\s+is\s+${MTU}
3636
^Internet\s+Address\s+is\s+allocated\s+by\s+DHCP,\s+${INTERNET_ADDRESS}\s*$$
3737
^Internet\s+Address\s+is\s+negotiated,\s+${INTERNET_ADDRESS}\s*$$
3838
^Internet\s+Address\s+is\s+${INTERNET_ADDRESS}\s*$$

ntc_templates/templates/huawei_vrp_display_port_vlan.textfsm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Value Required INTERFACE ([\w\.\/\-]+)
22
Value LINK_TYPE (trunk|access|auto|hybrid|desirable)
3-
Value PVID (\d+)
3+
Value VLAN_ID (\d+)
44
Value List TRUNK_VLAN_LIST (\d+\-\d+|\d+)
55

66

@@ -11,7 +11,7 @@ Start
1111

1212
VLANS
1313
^[\w\.\/\-]+ -> Continue.Record
14-
^${INTERFACE}\s+${LINK_TYPE}\s+${PVID}\s+${TRUNK_VLAN_LIST}\s* -> Continue
14+
^${INTERFACE}\s+${LINK_TYPE}\s+${VLAN_ID}\s+${TRUNK_VLAN_LIST}\s* -> Continue
1515
^[\w\.\/\-]+\s+(?:\S+\s+){3}${TRUNK_VLAN_LIST}\s* -> Continue
1616
^[\w\.\/\-]+\s+(?:\S+\s+){4}${TRUNK_VLAN_LIST}\s* -> Continue
1717
^[\w\.\/\-]+\s+(?:\S+\s+){5}${TRUNK_VLAN_LIST}\s* -> Continue
@@ -134,7 +134,7 @@ VLANS
134134
# Bundled interface (PVID is 0)
135135
^${INTERFACE}\s+-\s+0\s+-\s*$$ -> Record
136136
# Access port (PVID is empty)
137-
^${INTERFACE}\s+${LINK_TYPE}\s+${PVID}\s+-\s*$$ -> Record
137+
^${INTERFACE}\s+${LINK_TYPE}\s+${VLAN_ID}\s+-\s*$$ -> Record
138138
# Interface lists
139139
^[\w\.\/\-]+\s+\S+\s+\d+\s+[0-9\- ]+$$
140140
^\s{6,}

tests/huawei_vrp/display_interface/huawei_vrp_display_interface.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ parsed_sample:
2020
port_mode: ""
2121
port_type: "Route"
2222
protocol_status: "DOWN"
23-
pvid: ""
2423
speed: ""
2524
tpid: ""
25+
vlan_id: ""
2626
- aggregated_interfaces: []
2727
current_system_time: "2022-10-13 08:58:09"
2828
duplex: ""
@@ -43,9 +43,9 @@ parsed_sample:
4343
port_mode: ""
4444
port_type: "Route"
4545
protocol_status: "UP (spoofing)"
46-
pvid: ""
4746
speed: ""
4847
tpid: ""
48+
vlan_id: ""
4949
- aggregated_interfaces: []
5050
current_system_time: ""
5151
duplex: ""
@@ -66,9 +66,9 @@ parsed_sample:
6666
port_mode: ""
6767
port_type: ""
6868
protocol_status: "UP"
69-
pvid: ""
7069
speed: ""
7170
tpid: ""
71+
vlan_id: ""
7272
- aggregated_interfaces: []
7373
current_system_time: "2022-10-13 08:58:11"
7474
duplex: ""
@@ -89,9 +89,9 @@ parsed_sample:
8989
port_mode: ""
9090
port_type: "Route"
9191
protocol_status: "DOWN"
92-
pvid: ""
9392
speed: ""
9493
tpid: ""
94+
vlan_id: ""
9595
- aggregated_interfaces: []
9696
current_system_time: "2022-10-13 08:58:12"
9797
duplex: "HALF"
@@ -112,9 +112,9 @@ parsed_sample:
112112
port_mode: "COMMON COPPER"
113113
port_type: "Switch"
114114
protocol_status: "DOWN"
115-
pvid: "1"
116115
speed: "10"
117116
tpid: "8100(Hex)"
117+
vlan_id: "1"
118118
- aggregated_interfaces: []
119119
current_system_time: "2022-10-13 08:58:12"
120120
duplex: "FULL"
@@ -135,9 +135,9 @@ parsed_sample:
135135
port_mode: "COMMON COPPER"
136136
port_type: "Switch"
137137
protocol_status: "DOWN"
138-
pvid: "2"
139138
speed: "1000"
140139
tpid: "8100(Hex)"
140+
vlan_id: "2"
141141
- aggregated_interfaces: []
142142
current_system_time: "2022-10-13 08:58:12"
143143
duplex: "FULL"
@@ -158,9 +158,9 @@ parsed_sample:
158158
port_mode: "COMMON COPPER"
159159
port_type: "Switch"
160160
protocol_status: "UP"
161-
pvid: "100"
162161
speed: "1000"
163162
tpid: "8100(Hex)"
163+
vlan_id: "100"
164164
- aggregated_interfaces: []
165165
current_system_time: "2022-10-13 08:58:12"
166166
duplex: "FULL"
@@ -181,9 +181,9 @@ parsed_sample:
181181
port_mode: "COMMON COPPER"
182182
port_type: "Switch"
183183
protocol_status: "DOWN"
184-
pvid: "1"
185184
speed: "1000"
186185
tpid: "8100(Hex)"
186+
vlan_id: "1"
187187
- aggregated_interfaces: []
188188
current_system_time: "2022-10-13 08:58:13"
189189
duplex: "FULL"
@@ -204,9 +204,9 @@ parsed_sample:
204204
port_mode: "AUTO COPPER"
205205
port_type: "Route"
206206
protocol_status: "DOWN"
207-
pvid: ""
208207
speed: "1000"
209208
tpid: ""
209+
vlan_id: ""
210210
- aggregated_interfaces: []
211211
current_system_time: "2022-10-13 08:58:13"
212212
duplex: "FULL"
@@ -227,9 +227,9 @@ parsed_sample:
227227
port_mode: "COMMON COPPER"
228228
port_type: "Route"
229229
protocol_status: "DOWN"
230-
pvid: ""
231230
speed: "1000"
232231
tpid: ""
232+
vlan_id: ""
233233
- aggregated_interfaces: []
234234
current_system_time: "2022-10-13 08:58:13"
235235
duplex: ""
@@ -250,9 +250,9 @@ parsed_sample:
250250
port_mode: ""
251251
port_type: "Route"
252252
protocol_status: "UP (spoofing)"
253-
pvid: ""
254253
speed: ""
255254
tpid: ""
255+
vlan_id: ""
256256
- aggregated_interfaces: []
257257
current_system_time: "2022-10-13 08:58:13"
258258
duplex: ""
@@ -273,9 +273,9 @@ parsed_sample:
273273
port_mode: ""
274274
port_type: "Route"
275275
protocol_status: "UP"
276-
pvid: ""
277276
speed: ""
278277
tpid: ""
278+
vlan_id: ""
279279
- aggregated_interfaces: []
280280
current_system_time: "2022-10-13 08:58:13"
281281
duplex: ""
@@ -296,9 +296,9 @@ parsed_sample:
296296
port_mode: ""
297297
port_type: "Route"
298298
protocol_status: "DOWN"
299-
pvid: ""
300299
speed: ""
301300
tpid: ""
301+
vlan_id: ""
302302
- aggregated_interfaces: []
303303
current_system_time: "2022-10-13 08:58:13"
304304
duplex: ""
@@ -319,9 +319,9 @@ parsed_sample:
319319
port_mode: ""
320320
port_type: "Route"
321321
protocol_status: "UP"
322-
pvid: ""
323322
speed: ""
324323
tpid: ""
324+
vlan_id: ""
325325
- aggregated_interfaces: []
326326
current_system_time: "2022-10-13 08:58:14"
327327
duplex: ""
@@ -342,9 +342,9 @@ parsed_sample:
342342
port_mode: ""
343343
port_type: "Switch"
344344
protocol_status: "UP"
345-
pvid: ""
346345
speed: ""
347346
tpid: "8100(Hex)"
347+
vlan_id: ""
348348
- aggregated_interfaces: []
349349
current_system_time: "2022-10-13 08:58:14"
350350
duplex: ""
@@ -365,9 +365,9 @@ parsed_sample:
365365
port_mode: ""
366366
port_type: "Switch"
367367
protocol_status: "UP"
368-
pvid: ""
369368
speed: ""
370369
tpid: "8100(Hex)"
370+
vlan_id: ""
371371
- aggregated_interfaces: []
372372
current_system_time: "2022-10-13 08:58:14"
373373
duplex: ""
@@ -388,9 +388,9 @@ parsed_sample:
388388
port_mode: ""
389389
port_type: "Switch"
390390
protocol_status: "UP"
391-
pvid: ""
392391
speed: ""
393392
tpid: "8100(Hex)"
393+
vlan_id: ""
394394
- aggregated_interfaces: []
395395
current_system_time: "2022-10-13 08:58:14"
396396
duplex: ""
@@ -411,9 +411,9 @@ parsed_sample:
411411
port_mode: ""
412412
port_type: "Switch"
413413
protocol_status: "UP"
414-
pvid: ""
415414
speed: ""
416415
tpid: "8100(Hex)"
416+
vlan_id: ""
417417
- aggregated_interfaces: []
418418
current_system_time: "2012-08-09 18:53:47"
419419
duplex: ""
@@ -434,9 +434,9 @@ parsed_sample:
434434
port_mode: ""
435435
port_type: "Route"
436436
protocol_status: "UP"
437-
pvid: ""
438437
speed: ""
439438
tpid: ""
439+
vlan_id: ""
440440
- aggregated_interfaces: []
441441
current_system_time: "2018-01-25 19:42:36"
442442
duplex: ""
@@ -457,6 +457,6 @@ parsed_sample:
457457
port_mode: ""
458458
port_type: "Switch"
459459
protocol_status: "UP"
460-
pvid: "1"
461460
speed: ""
462461
tpid: "8100(Hex)"
462+
vlan_id: "1"

0 commit comments

Comments
 (0)