Skip to content

Commit f3dc29d

Browse files
committed
Fix inband vlan test
1 parent cdf5f36 commit f3dc29d

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

tests/test_virtual_chassis.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,20 @@ def config_inbandif(self, vct, inbandif_name, inband_type):
4141
if cfg_switch_type == "voq":
4242
if inband_type == "port":
4343
dvs.runcmd(f"config interface startup {inbandif_name}")
44-
config_db.create_entry("VOQ_INBAND_INTERFACE", f"{inbandif_name}", {"inband_type": f"{inband_type}"})
44+
config_db.create_entry("VOQ_INBAND_INTERFACE", f"{inbandif_name}", {"inband_type": f"{inband_type}"})
45+
else
46+
config_db.create_entry("VOQ_INBAND_INTERFACE", f"{inbandif_name}",
47+
{"inband_type": f"{inband_type}", "hostif_required": "0"})
48+
49+
# Wait for inband Vlan to be created in SAI
50+
state_db = dvs.get_state_db()
51+
result = state_db.wait_for_entry("VLAN_TABLE", f"{inbandif_name}")
52+
assert result["state"] == "ok"
53+
54+
# Vlan type hostif is not supported in VS. So create a dummy kernel intf for inband vlan.
55+
dvs.runcmd(f"ip link add {inbandif_name} type dummy")
4556

46-
def del_inbandif(self, vct, inbandif_name):
57+
def del_inbandif(self, vct, inbandif_name, inband_type):
4758
"""This function deletes existing inband interface"""
4859

4960
dvss = vct.dvss
@@ -58,7 +69,9 @@ def del_inbandif(self, vct, inbandif_name):
5869
# Applicable only for line cards
5970
if cfg_switch_type == "voq":
6071
config_db.delete_entry("VOQ_INBAND_INTERFACE", f"{inbandif_name}")
61-
72+
if inband_type == "vlan":
73+
dvs.runcmd(f"ip link delete {inbandif_name}")
74+
6275
def test_connectivity(self, vct):
6376
if vct is None:
6477
return
@@ -294,6 +307,10 @@ def do_test_chassis_system_neigh(self, vct, inband_type):
294307
encap_index = test_neigh_entry_attrs["SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX"]
295308
assert encap_index != "" and encap_index != None, "VOQ encap index is not programmed in ASIC_DB"
296309

310+
# Router mac is published into chassis system neigh table if inband type is vlan.
311+
if inband_type == "vlan":
312+
test_neigh_mac = metatbl.get("mac").upper()
313+
297314
break
298315

299316
# Verify neighbor record syncing with encap index
@@ -470,7 +487,7 @@ def do_test_chassis_system_neigh(self, vct, inband_type):
470487
break
471488

472489
# Cleanup inband if configuration
473-
self.del_inbandif(vct, inbandif_name)
490+
self.del_inbandif(vct, inbandif_name, inband_type)
474491

475492
def test_chassis_system_neigh_with_inband_port(self, vct):
476493
"""Test neigh record create/delete and syncing to chassis app db with inband port.

0 commit comments

Comments
 (0)