Skip to content

Commit 49335ba

Browse files
authored
remove low speed port from test port list for breakout test scenario (#12084)
What is the motivation for this PR? Regarding to 7050qx's QoS SAI test for topo t0: test port select result is as below: testPortIds={0: {0: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]}}; and 1,2,3 are low speed breakout port. as below: admin@bjw-can-7050qx-3:~$ show int st Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC Ethernet0 9 10G 9100 N/A Ethernet1 routed up down SFP/SFP+/SFP28 off Ethernet1 10 10G 9100 N/A Ethernet2 trunk up up SFP/SFP+/SFP28 off Ethernet2 11 10G 9100 N/A Ethernet3 trunk up up SFP/SFP+/SFP28 off Ethernet3 12 1G 9100 N/A Ethernet4 trunk up up SFP/SFP+/SFP28 off Ethernet4 13,14,15,16 40G 9100 N/A Ethernet6/1 trunk up up QSFP+ or later with SFF-8636 or SFF-8436 off it cause two issue: caused using wrong test target porfile for qos sai test. as below: profileName = ingressLosslessProfile["profileName"] >>>>> [Xu]: just get profile of first test port, in this function. logger.info( "Lossless Buffer profile selected is {}".format(profileName)) if self.isBufferInApplDb(dut_asic): profile_pattern = "^BUFFER_PROFILE_TABLE\\:pg_lossless_(.*)_profile$" else: profile_pattern = "^BUFFER_PROFILE\\|pg_lossless_(.*)_profile" m = re.search(profile_pattern, profileName) pytest_assert(m.group(1), "Cannot find port speed/cable length") # portSpeedCableLength = m.group(1) portSpeedCableLength = "40000_300m" >>>> [Xu]: according to above sample result of test port selection, first port' id is 1 (it's Etherent1), the corresponding PG lossless porfile is "pg_lossless_10000_300m_profile". so we can never get expected pg_lossless_40000_300m_profile profile. cause qos sai test traffic go through low speed breakout port rather than high speed 40G port and eventually, caused Xon case failure. How did you do it? remove low speed port out of test port list How did you verify/test it? pass UT
1 parent 282a231 commit 49335ba

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/qos/qos_sai_base.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import six
1111
import copy
1212
import time
13+
import collections
1314

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

45+
BREAKOUT_SKUS = ['Arista-7050-QX-32S']
46+
4447
TARGET_QUEUE_WRED = 3
4548
TARGET_LOSSY_QUEUE_SCHED = 0
4649
TARGET_LOSSLESS_QUEUE_SCHED = 3
@@ -794,6 +797,12 @@ def __buildTestPorts(self, request, testPortIds, testPortIps, src_port_ids, dst_
794797
"dst_sys_ports": dst_all_sys_port
795798
}
796799

800+
def __buildPortSpeeds(self, config_facts):
801+
port_speeds = collections.defaultdict(list)
802+
for etp, attr in config_facts['PORT'].items():
803+
port_speeds[attr['speed']].append(etp)
804+
return port_speeds
805+
797806
@pytest.fixture(scope='class', autouse=True)
798807
def dutConfig(
799808
self, request, duthosts, get_src_dst_asic_and_duts,
@@ -847,9 +856,19 @@ def dutConfig(
847856
for intf in lag["members"]:
848857
dutLagInterfaces.append(src_mgFacts["minigraph_ptf_indices"][intf])
849858

859+
config_facts = duthosts.config_facts(host=src_dut.hostname, source="running")
860+
port_speeds = self.__buildPortSpeeds(config_facts[src_dut.hostname])
861+
low_speed_portIds = []
862+
if src_dut.facts['hwsku'] in self.BREAKOUT_SKUS and 'backend' not in topo:
863+
for speed, portlist in port_speeds.items():
864+
if int(speed) < 40000:
865+
for portname in portlist:
866+
low_speed_portIds.append(src_mgFacts["minigraph_ptf_indices"][portname])
867+
850868
testPortIds[src_dut_index][src_asic_index] = set(src_mgFacts["minigraph_ptf_indices"][port]
851869
for port in src_mgFacts["minigraph_ports"].keys())
852870
testPortIds[src_dut_index][src_asic_index] -= set(dutLagInterfaces)
871+
testPortIds[src_dut_index][src_asic_index] -= set(low_speed_portIds)
853872
if isMellanoxDevice(src_dut):
854873
# The last port is used for up link from DUT switch
855874
testPortIds[src_dut_index][src_asic_index] -= {len(src_mgFacts["minigraph_ptf_indices"]) - 1}

tests/qos/test_qos_sai.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ class TestQosSai(QosSaiBase):
138138
'Arista-7050CX3-32S-D48C8'
139139
]
140140

141-
BREAKOUT_SKUS = ['Arista-7050-QX-32S']
142-
143141
@pytest.fixture(scope='function')
144142
def change_port_speed(
145143
self, request, ptfhost, duthosts, dutTestParams, fanouthosts, dutConfig, tbinfo,

0 commit comments

Comments
 (0)