Skip to content

Commit 5cf9b60

Browse files
changed according to multi_asic_intfutil_test.py output from Vlan to Mode
1 parent a507786 commit 5cf9b60

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

config/vlan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def add_vlan_member(db, vid, port, untagged, multiple, except_flag):
256256
port_data = port_table_data[port]
257257

258258
if "mode" not in port_data:
259-
ctx.fail("{} is in routed mode!\nUse switchport mode command to changes port mode")
259+
ctx.fail("{} is in routed mode!\nUse switchport mode command to changes port mode".format(port))
260260
else:
261261
existing_mode = port_data["mode"]
262262

tests/mock_tables/config_db.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"lanes": "25,26,27,28",
3030
"mtu": "9100",
3131
"tpid": "0x8100",
32+
"mode": "routed",
3233
"pfc_asym": "off",
3334
"speed": "40000"
3435
},
@@ -40,6 +41,7 @@
4041
"lanes": "29,30,31,32",
4142
"mtu": "9100",
4243
"tpid": "0x8100",
44+
"mode": "trunk",
4345
"pfc_asym": "off",
4446
"speed": "40000"
4547
},
@@ -51,6 +53,7 @@
5153
"lanes": "33,34,35,36",
5254
"mtu": "9100",
5355
"tpid": "0x8100",
56+
"mode": "routed",
5457
"pfc_asym": "off",
5558
"speed": "40000"
5659
},
@@ -62,6 +65,7 @@
6265
"lanes": "37,38,39,40",
6366
"mtu": "9100",
6467
"tpid": "0x8100",
68+
"mode": "routed",
6569
"pfc_asym": "off",
6670
"speed": "40000"
6771
},
@@ -73,6 +77,7 @@
7377
"lanes": "16",
7478
"mtu": "9100",
7579
"tpid": "0x8100",
80+
"mode": "trunk",
7681
"pfc_asym": "off",
7782
"speed": "100"
7883
},
@@ -84,6 +89,7 @@
8489
"lanes": "41,42,43,44",
8590
"mtu": "9100",
8691
"tpid": "0x9200",
92+
"mode": "routed",
8793
"pfc_asym": "off",
8894
"speed": "40000"
8995
},
@@ -95,6 +101,7 @@
95101
"lanes": "1,2,3,4",
96102
"mtu": "9100",
97103
"tpid": "0x8100",
104+
"mode": "trunk",
98105
"pfc_asym": "off",
99106
"speed": "1000"
100107
},
@@ -106,6 +113,7 @@
106113
"lanes": "5,6,7,8",
107114
"mtu": "9100",
108115
"tpid": "0x8100",
116+
"mode": "trunk",
109117
"pfc_asym": "off",
110118
"speed": "1000"
111119
},
@@ -117,6 +125,7 @@
117125
"lanes": "13,14,15,16",
118126
"mtu": "9100",
119127
"tpid": "0x8100",
128+
"mode": "routed",
120129
"pfc_asym": "off",
121130
"speed": "40000"
122131
},
@@ -128,6 +137,7 @@
128137
"lanes": "9,10,11,12",
129138
"mtu": "9100",
130139
"tpid": "0x8100",
140+
"mode": "routed",
131141
"pfc_asym": "off",
132142
"speed": "10"
133143
},
@@ -139,6 +149,7 @@
139149
"lanes": "17,18,19,20",
140150
"mtu": "9100",
141151
"tpid": "0x8100",
152+
"mode": "trunk",
142153
"pfc_asym": "off",
143154
"speed": "40000"
144155
},
@@ -150,6 +161,7 @@
150161
"lanes": "21,22,23,24",
151162
"mtu": "9100",
152163
"tpid": "0x8100",
164+
"mode": "routed",
153165
"pfc_asym": "off",
154166
"speed": "40000"
155167
},
@@ -161,6 +173,7 @@
161173
"lanes": "53,54,55,56",
162174
"mtu": "9100",
163175
"tpid": "0x8100",
176+
"mode": "routed",
164177
"pfc_asym": "off",
165178
"speed": "40000"
166179
},
@@ -172,6 +185,7 @@
172185
"lanes": "49,50,51,52",
173186
"mtu": "9100",
174187
"tpid": "0x8100",
188+
"mode": "routed",
175189
"pfc_asym": "off",
176190
"speed": "40000"
177191
},
@@ -183,6 +197,7 @@
183197
"lanes": "57,58,59,60",
184198
"mtu": "9100",
185199
"tpid": "0x8100",
200+
"mode": "routed",
186201
"pfc_asym": "off",
187202
"speed": "40000"
188203
},
@@ -194,6 +209,7 @@
194209
"lanes": "61,62,63,64",
195210
"mtu": "9100",
196211
"tpid": "0x8100",
212+
"mode": "routed",
197213
"pfc_asym": "off",
198214
"speed": "40000"
199215
},
@@ -205,6 +221,7 @@
205221
"lanes": "69,70,71,72",
206222
"mtu": "9100",
207223
"tpid": "0x8100",
224+
"mode": "routed",
208225
"pfc_asym": "off",
209226
"speed": "40000"
210227
},
@@ -216,6 +233,7 @@
216233
"lanes": "65,66,67,68",
217234
"mtu": "9100",
218235
"tpid": "0x8100",
236+
"mode": "routed",
219237
"pfc_asym": "off",
220238
"speed": "40000"
221239
},
@@ -227,6 +245,7 @@
227245
"lanes": "73,74,75,76",
228246
"mtu": "9100",
229247
"tpid": "0x8100",
248+
"mode": "routed",
230249
"pfc_asym": "off",
231250
"speed": "40000"
232251
},
@@ -238,6 +257,7 @@
238257
"lanes": "77,78,79,80",
239258
"mtu": "9100",
240259
"tpid": "0x8100",
260+
"mode": "routed",
241261
"pfc_asym": "off",
242262
"speed": "40000"
243263
},
@@ -249,6 +269,7 @@
249269
"lanes": "109,110,111,112",
250270
"mtu": "9100",
251271
"tpid": "0x8100",
272+
"mode": "routed",
252273
"pfc_asym": "off",
253274
"speed": "40000"
254275
},
@@ -260,6 +281,7 @@
260281
"lanes": "105,106,107,108",
261282
"mtu": "9100",
262283
"tpid": "0x8100",
284+
"mode": "routed",
263285
"pfc_asym": "off",
264286
"speed": "40000"
265287
},
@@ -271,6 +293,7 @@
271293
"lanes": "113,114,115,116",
272294
"mtu": "9100",
273295
"tpid": "0x8100",
296+
"mode": "routed",
274297
"pfc_asym": "off",
275298
"speed": "40000"
276299
},
@@ -282,6 +305,7 @@
282305
"lanes": "117,118,119,120",
283306
"mtu": "9100",
284307
"tpid": "0x8100",
308+
"mode": "routed",
285309
"pfc_asym": "off",
286310
"speed": "40000"
287311
},
@@ -293,6 +317,7 @@
293317
"lanes": "125,126,127,128",
294318
"mtu": "9100",
295319
"tpid": "0x8100",
320+
"mode": "routed",
296321
"pfc_asym": "off",
297322
"speed": "40000"
298323
},
@@ -303,6 +328,7 @@
303328
"lanes": "121,122,123,124",
304329
"mtu": "9100",
305330
"tpid": "0x8100",
331+
"mode": "routed",
306332
"pfc_asym": "off",
307333
"speed": "40000"
308334
},
@@ -313,6 +339,7 @@
313339
"lanes": "81,82,83,84",
314340
"mtu": "9100",
315341
"tpid": "0x8100",
342+
"mode": "routed",
316343
"pfc_asym": "off",
317344
"speed": "40000"
318345
},
@@ -323,6 +350,7 @@
323350
"lanes": "85,86,87,88",
324351
"mtu": "9100",
325352
"tpid": "0x8100",
353+
"mode": "routed",
326354
"pfc_asym": "off",
327355
"speed": "40000"
328356
},
@@ -334,6 +362,7 @@
334362
"lanes": "93,94,95,96",
335363
"mtu": "9100",
336364
"tpid": "0x8100",
365+
"mode": "routed",
337366
"pfc_asym": "off",
338367
"speed": "40000"
339368
},
@@ -345,6 +374,7 @@
345374
"lanes": "89,90,91,92",
346375
"mtu": "9100",
347376
"tpid": "0x8100",
377+
"mode": "routed",
348378
"pfc_asym": "off",
349379
"speed": "40000"
350380
},
@@ -356,6 +386,7 @@
356386
"lanes": "101,102,103,104",
357387
"mtu": "9100",
358388
"tpid": "0x8100",
389+
"mode": "routed",
359390
"pfc_asym": "off",
360391
"speed": "40000"
361392
},
@@ -367,6 +398,7 @@
367398
"lanes": "97,98,99,100",
368399
"mtu": "9100",
369400
"tpid": "0x8100",
401+
"mode": "routed",
370402
"pfc_asym": "off",
371403
"speed": "40000"
372404
},
@@ -2619,4 +2651,4 @@
26192651
"src_port": "Ethernet40,Ethernet48",
26202652
"direction": "RX"
26212653
}
2622-
}
2654+
}

tests/multi_asic_intfutil_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
scripts_path = os.path.join(modules_path, "scripts")
1111

1212
intf_status_all = """\
13-
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
13+
Interface Lanes Speed MTU FEC Alias Mode Oper Admin Type Asym PFC
1414
--------------- ------------ ------- ----- ----- -------------- --------------- ------ ------- --------------- ----------
1515
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
1616
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
@@ -24,23 +24,23 @@
2424
PortChannel4009 N/A 80G 9100 N/A N/A routed up up N/A N/A
2525
"""
2626
intf_status = """\
27-
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
27+
Interface Lanes Speed MTU FEC Alias Mode Oper Admin Type Asym PFC
2828
--------------- ----------- ------- ----- ----- ----------- --------------- ------ ------- --------------- ----------
2929
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
3030
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
3131
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
3232
"""
3333

3434
intf_status_asic0 = """\
35-
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
35+
Interface Lanes Speed MTU FEC Alias Mode Oper Admin Type Asym PFC
3636
--------------- ----------- ------- ----- ----- ----------- --------------- ------ ------- --------------- ----------
3737
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
3838
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off
3939
PortChannel1002 N/A 80G 9100 N/A N/A trunk up up N/A N/A
4040
"""
4141

4242
intf_status_asic0_all = """\
43-
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
43+
Interface Lanes Speed MTU FEC Alias Mode Oper Admin Type Asym PFC
4444
--------------- ------------ ------- ----- ----- ------------ --------------- ------ ------- --------------- ----------
4545
Ethernet0 33,34,35,36 40G 9100 N/A Ethernet1/1 PortChannel1002 up up QSFP28 or later off
4646
Ethernet4 29,30,31,32 40G 9100 N/A Ethernet1/2 PortChannel1002 up up N/A off

0 commit comments

Comments
 (0)