Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class QosBase:
"""
Common APIs
"""
SUPPORTED_T0_TOPOS = ["t0", "t0-64", "t0-116", "t0-35", "dualtor-56", "dualtor-120", "dualtor", "t0-80", "t0-backend"]
SUPPORTED_T0_TOPOS = ["t0", "t0-56-po2vlan", "t0-64", "t0-116", "t0-35", "dualtor-56", "dualtor-120", "dualtor",
"t0-80", "t0-backend"]
SUPPORTED_T1_TOPOS = ["t1-lag", "t1-64-lag", "t1-56-lag", "t1-backend"]
SUPPORTED_PTF_TOPOS = ['ptf32', 'ptf64']
SUPPORTED_ASIC_LIST = ["gr", "gb", "td2", "th", "th2", "spc1", "spc2", "spc3", "td3", "th3", "j2c+", "jr2"]
Expand Down Expand Up @@ -414,7 +415,7 @@ def __getSchedulerParam(self, dut_asic, port, queue):

return {"schedProfile": schedProfile, "schedWeight": schedWeight}

def __assignTestPortIps(self, mgFacts):
def __assignTestPortIps(self, mgFacts, topo):
"""
Assign IPs to test ports of DUT host

Expand All @@ -426,9 +427,19 @@ def __assignTestPortIps(self, mgFacts):
"""
dutPortIps = {}
if len(mgFacts["minigraph_vlans"]) > 0:
#TODO: handle the case when there are multiple vlans
testVlan = next(iter(mgFacts["minigraph_vlans"]))
# TODO: handle the case when there are multiple vlans
vlans = iter(mgFacts["minigraph_vlans"])
testVlan = next(vlans)
testVlanMembers = mgFacts["minigraph_vlans"][testVlan]["members"]
# To support t0-56-po2vlan topo, choose the Vlan with physical ports and remove the lag in Vlan members
if topo == 't0-56-po2vlan':
if len(testVlanMembers) == 1:
testVlan = next(vlans)
testVlanMembers = mgFacts["minigraph_vlans"][testVlan]["members"]
for member in testVlanMembers:
if 'PortChannel' in member:
testVlanMembers.remove(member)
break

testVlanIp = None
for vlan in mgFacts["minigraph_vlan_interfaces"]:
Expand Down Expand Up @@ -769,7 +780,7 @@ def dutConfig(
uplinkPortNames.append(intf)

testPortIps[src_dut_index] = {}
testPortIps[src_dut_index][src_asic_index] = self.__assignTestPortIps(src_mgFacts)
testPortIps[src_dut_index][src_asic_index] = self.__assignTestPortIps(src_mgFacts, topo)

# restore currently assigned IPs
if len(dutPortIps[src_dut_index][src_asic_index]) != 0:
Expand Down