diff --git a/tests/qos/qos_sai_base.py b/tests/qos/qos_sai_base.py index 75d025d2ec8..a6033b47730 100644 --- a/tests/qos/qos_sai_base.py +++ b/tests/qos/qos_sai_base.py @@ -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 @@ -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 @@ -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, @@ -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} diff --git a/tests/qos/test_qos_sai.py b/tests/qos/test_qos_sai.py index b1272677497..1c107dbf9ce 100644 --- a/tests/qos/test_qos_sai.py +++ b/tests/qos/test_qos_sai.py @@ -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,