Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import six
import copy
import time
import collections

from tests.common.fixtures.ptfhost_utils import ptf_portmap_file # noqa F401
from tests.common.helpers.assertions import pytest_assert, pytest_require
Expand Down Expand Up @@ -41,6 +42,8 @@ class QosBase:
SUPPORTED_ASIC_LIST = ["pac", "gr", "gb", "td2", "th", "th2", "spc1", "spc2", "spc3", "spc4", "td3", "th3",
"j2c+", "jr2"]

BREAKOUT_SKUS = ['Arista-7050-QX-32S']

TARGET_QUEUE_WRED = 3
TARGET_LOSSY_QUEUE_SCHED = 0
TARGET_LOSSLESS_QUEUE_SCHED = 3
Expand Down Expand Up @@ -751,6 +754,12 @@ def __buildTestPorts(self, request, testPortIds, testPortIps, src_port_ids,
"src_port_vlan": srcVlan
}

def __buildPortSpeeds(self, config_facts):
port_speeds = collections.defaultdict(list)
for etp, attr in config_facts['PORT'].items():
port_speeds[attr['speed']].append(etp)
return port_speeds

@pytest.fixture(scope='class', autouse=True)
def dutConfig(
self, request, duthosts, get_src_dst_asic_and_duts,
Expand Down Expand Up @@ -803,9 +812,19 @@ def dutConfig(
for intf in lag["members"]:
dutLagInterfaces.append(src_mgFacts["minigraph_ptf_indices"][intf])

config_facts = duthosts.config_facts(host=src_dut.hostname, source="running")
port_speeds = self.__buildPortSpeeds(config_facts[src_dut.hostname])
low_speed_portIds = []
if src_dut.facts['hwsku'] in self.BREAKOUT_SKUS and 'backend' not in topo:
for speed, portlist in port_speeds.items():
if int(speed) < 40000:
for portname in portlist:
low_speed_portIds.append(src_mgFacts["minigraph_ptf_indices"][portname])

testPortIds[src_dut_index][src_asic_index] = set(src_mgFacts["minigraph_ptf_indices"][port]
for port in src_mgFacts["minigraph_ports"].keys())
testPortIds[src_dut_index][src_asic_index] -= set(dutLagInterfaces)
testPortIds[src_dut_index][src_asic_index] -= set(low_speed_portIds)
if isMellanoxDevice(src_dut):
# The last port is used for up link from DUT switch
testPortIds[src_dut_index][src_asic_index] -= {len(src_mgFacts["minigraph_ptf_indices"]) - 1}
Expand Down
2 changes: 0 additions & 2 deletions tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ class TestQosSai(QosSaiBase):
'Arista-7050CX3-32S-D48C8'
]

BREAKOUT_SKUS = ['Arista-7050-QX-32S']

@pytest.fixture(scope='function')
def change_port_speed(
self, request, ptfhost, duthosts, dutTestParams, fanouthosts, dutConfig, tbinfo,
Expand Down