Skip to content

Commit f4fb3db

Browse files
vmittal-msftansrajpu-git
authored andcommitted
[J2C+] QoS/PFC test fixes for SONIC chassis (sonic-net#7079)
* QoS test fixes for chassis ----------------------------------------------------------- Co-authored-by: ansrajpu <[email protected]>
1 parent 1f454b0 commit f4fb3db

9 files changed

Lines changed: 519 additions & 239 deletions

File tree

tests/common/fixtures/duthost_utils.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,21 @@ def dut_qos_maps(rand_selected_dut):
458458
"""
459459
maps = {}
460460
try:
461+
if rand_selected_dut.is_multi_asic:
462+
sonic_cfggen_cmd = "sonic-cfggen -n asic0 -d --var-json"
463+
else:
464+
sonic_cfggen_cmd = "sonic-cfggen -d --var-json"
465+
461466
# port_qos_map
462-
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'PORT_QOS_MAP'")['stdout'])
467+
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("{} 'PORT_QOS_MAP'".format(sonic_cfggen_cmd))['stdout'])
463468
# dscp_to_tc_map
464-
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'DSCP_TO_TC_MAP'")['stdout'])
469+
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("{} 'DSCP_TO_TC_MAP'".format(sonic_cfggen_cmd))['stdout'])
465470
# tc_to_queue_map
466-
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_QUEUE_MAP'")['stdout'])
471+
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_QUEUE_MAP'".format(sonic_cfggen_cmd))['stdout'])
467472
# tc_to_priority_group_map
468-
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_PRIORITY_GROUP_MAP'")['stdout'])
473+
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_PRIORITY_GROUP_MAP'".format(sonic_cfggen_cmd))['stdout'])
469474
# tc_to_dscp_map
470-
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_DSCP_MAP'")['stdout'])
475+
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_DSCP_MAP'".format(sonic_cfggen_cmd))['stdout'])
471476
except:
472477
pass
473478
return maps

tests/common/fixtures/ptfhost_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _ptf_portmap_file(duthost, ptfhost, tbinfo):
183183
filename (str): returns the filename copied to PTF host
184184
"""
185185
intfInfo = duthost.show_interface(command = "status")['ansible_facts']['int_status']
186-
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up']
186+
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up' and intfInfo[port]['admin_state'] == 'up']
187187
mg_facts = duthost.get_extended_minigraph_facts(tbinfo)
188188
portMapFile = "/tmp/default_interface_to_front_map.ini"
189189
with open(portMapFile, 'w') as file:
@@ -529,11 +529,16 @@ def ptf_test_port_map_active_active(ptfhost, tbinfo, duthosts, mux_server_url, d
529529
if target_dut_port in mg_facts['minigraph_port_indices'].values():
530530
router_mac = duts_running_config_facts[duthosts[target_dut_index].hostname][idx]['DEVICE_METADATA']['localhost']['mac'].lower()
531531
asic_idx = idx
532+
for a_dut_port, a_dut_port_index in mg_facts['minigraph_port_indices'].items():
533+
if a_dut_port_index == target_dut_port and "Ethernet-Rec" not in a_dut_port and \
534+
"Ethernet-IB" not in a_dut_port and "Ethernet-BP" not in a_dut_port:
535+
dut_port = a_dut_port
532536
break
533537
ports_map[ptf_port] = {
534538
'target_dut': [target_dut_index],
535539
'target_dest_mac': router_mac,
536540
'target_src_mac': [router_mac],
541+
'dut_port': dut_port,
537542
'asic_idx': asic_idx
538543
}
539544

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@ qos/test_buffer_traditional.py:
680680
conditions:
681681
- "is_multi_asic==True or release not in ['201911']"
682682

683+
qos/test_buffer.py:
684+
skip:
685+
reason: "Tests are relevant to dynamic buffering not required on T2"
686+
conditions:
687+
- "'t2' in topo_name"
688+
683689
qos/test_pfc_pause.py::test_pfc_pause_lossless:
684690
# For this test, we use the fanout connected to the DUT to send PFC pause frames.
685691
# The fanout needs to send PFC frames fast enough so that the queue remains completely paused for the entire duration
@@ -745,10 +751,20 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:
745751

746752
qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:
747753
skip:
754+
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
755+
conditions:
756+
- "platform in ['x86_64-nokia_ixr7250e_36x400g-r0', 'x86_64-arista_7800r3_48cq2_lc', 'x86_64-arista_7800r3_48cqm2_lc', 'x86_64-arista_7800r3a_36d2_lc']"
757+
xfail:
748758
reason: "Headroom pool size not supported."
749759
conditions:
750760
- "hwsku not in ['Arista-7060CX-32S-C32', 'Celestica-DX010-C32', 'Arista-7260CX3-D108C8', 'Force10-S6100', 'Arista-7260CX3-Q64', 'Arista-7050CX3-32S-C32', 'Arista-7050CX3-32S-D48C8']"
751761

762+
qos/test_qos_sai.py::TestQosSai::testQosSaiBufferPoolWatermark:
763+
skip:
764+
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
765+
conditions:
766+
- "platform in ['x86_64-nokia_ixr7250e_36x400g-r0', 'x86_64-arista_7800r3_48cq2_lc', 'x86_64-arista_7800r3_48cqm2_lc', 'x86_64-arista_7800r3a_36d2_lc']"
767+
752768
qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
753769
skip:
754770
reason: "PG drop size test is not supported."

tests/conftest.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ def duts_running_config_facts(duthosts):
16651665

16661666
@pytest.fixture(scope='class')
16671667
def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
1668-
ptf_portmap_file, lower_tor_host): # noqa F811
1668+
ptf_portmap_file, lower_tor_host, creds): # noqa F811
16691669
"""
16701670
Prepares DUT host test params
16711671
@@ -1685,7 +1685,7 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
16851685
mgFacts = duthost.get_extended_minigraph_facts(tbinfo)
16861686
topo = tbinfo["topo"]["name"]
16871687

1688-
yield {
1688+
rtn_dict = {
16891689
"topo": topo,
16901690
"hwsku": mgFacts["minigraph_hwsku"],
16911691
"basicParams": {
@@ -1695,10 +1695,15 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
16951695
).vars['ansible_host'],
16961696
"port_map_file": ptf_portmap_file,
16971697
"sonic_asic_type": duthost.facts['asic_type'],
1698-
"sonic_version": duthost.os_version
1698+
"sonic_version": duthost.os_version,
1699+
"dut_username": creds['sonicadmin_user'],
1700+
"dut_password": creds['sonicadmin_password']
16991701
}
17001702
}
1703+
if 'platform_asic' in duthost.facts:
1704+
rtn_dict['basicParams']["platform_asic"] = duthost.facts['platform_asic']
17011705

1706+
yield rtn_dict
17021707

17031708
@pytest.fixture(scope='module')
17041709
def duts_minigraph_facts(duthosts, tbinfo):

0 commit comments

Comments
 (0)