Skip to content

Commit b76ab3f

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 99ecad1 commit b76ab3f

File tree

9 files changed

+519
-238
lines changed

9 files changed

+519
-238
lines changed

tests/common/fixtures/duthost_utils.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,21 @@ def dut_qos_maps(rand_selected_dut):
441441
"""
442442
maps = {}
443443
try:
444+
if rand_selected_dut.is_multi_asic:
445+
sonic_cfggen_cmd = "sonic-cfggen -n asic0 -d --var-json"
446+
else:
447+
sonic_cfggen_cmd = "sonic-cfggen -d --var-json"
448+
444449
# port_qos_map
445-
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'PORT_QOS_MAP'")['stdout'])
450+
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("{} 'PORT_QOS_MAP'".format(sonic_cfggen_cmd))['stdout'])
446451
# dscp_to_tc_map
447-
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'DSCP_TO_TC_MAP'")['stdout'])
452+
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("{} 'DSCP_TO_TC_MAP'".format(sonic_cfggen_cmd))['stdout'])
448453
# tc_to_queue_map
449-
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_QUEUE_MAP'")['stdout'])
454+
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_QUEUE_MAP'".format(sonic_cfggen_cmd))['stdout'])
450455
# tc_to_priority_group_map
451-
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_PRIORITY_GROUP_MAP'")['stdout'])
456+
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_PRIORITY_GROUP_MAP'".format(sonic_cfggen_cmd))['stdout'])
452457
# tc_to_dscp_map
453-
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_DSCP_MAP'")['stdout'])
458+
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_DSCP_MAP'".format(sonic_cfggen_cmd))['stdout'])
454459
except:
455460
pass
456461
return maps

tests/common/fixtures/ptfhost_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _ptf_portmap_file(duthost, ptfhost, tbinfo):
182182
filename (str): returns the filename copied to PTF host
183183
"""
184184
intfInfo = duthost.show_interface(command = "status")['ansible_facts']['int_status']
185-
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up']
185+
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up' and intfInfo[port]['admin_state'] == 'up']
186186
mg_facts = duthost.get_extended_minigraph_facts(tbinfo)
187187
portMapFile = "/tmp/default_interface_to_front_map.ini"
188188
with open(portMapFile, 'w') as file:
@@ -523,11 +523,16 @@ def ptf_test_port_map_active_active(ptfhost, tbinfo, duthosts, mux_server_url, d
523523
if target_dut_port in mg_facts['minigraph_port_indices'].values():
524524
router_mac = duts_running_config_facts[duthosts[target_dut_index].hostname][idx]['DEVICE_METADATA']['localhost']['mac'].lower()
525525
asic_idx = idx
526+
for a_dut_port, a_dut_port_index in mg_facts['minigraph_port_indices'].items():
527+
if a_dut_port_index == target_dut_port and "Ethernet-Rec" not in a_dut_port and \
528+
"Ethernet-IB" not in a_dut_port and "Ethernet-BP" not in a_dut_port:
529+
dut_port = a_dut_port
526530
break
527531
ports_map[ptf_port] = {
528532
'target_dut': [target_dut_index],
529533
'target_dest_mac': router_mac,
530534
'target_src_mac': [router_mac],
535+
'dut_port': dut_port,
531536
'asic_idx': asic_idx
532537
}
533538

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml

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

669+
qos/test_buffer.py:
670+
skip:
671+
reason: "Tests are relevant to dynamic buffering not required on T2"
672+
conditions:
673+
- "'t2' in topo_name"
674+
669675
qos/test_pfc_pause.py::test_pfc_pause_lossless:
670676
# For this test, we use the fanout connected to the DUT to send PFC pause frames.
671677
# The fanout needs to send PFC frames fast enough so that the queue remains completely paused for the entire duration
@@ -731,10 +737,20 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:
731737

732738
qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:
733739
skip:
740+
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
741+
conditions:
742+
- "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']"
743+
xfail:
734744
reason: "Headroom pool size not supported."
735745
conditions:
736746
- "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']"
737747

748+
qos/test_qos_sai.py::TestQosSai::testQosSaiBufferPoolWatermark:
749+
skip:
750+
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
751+
conditions:
752+
- "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']"
753+
738754
qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
739755
skip:
740756
reason: "PG drop size test is not supported."

tests/conftest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,8 @@ def duts_running_config_facts(duthosts):
15631563
return cfg_facts
15641564

15651565
@pytest.fixture(scope='class')
1566-
def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo, ptf_portmap_file, lower_tor_host):
1566+
def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
1567+
ptf_portmap_file, lower_tor_host, creds): # noqa F811
15671568
"""
15681569
Prepares DUT host test params
15691570
@@ -1583,7 +1584,7 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
15831584
mgFacts = duthost.get_extended_minigraph_facts(tbinfo)
15841585
topo = tbinfo["topo"]["name"]
15851586

1586-
yield {
1587+
rtn_dict = {
15871588
"topo": topo,
15881589
"hwsku": mgFacts["minigraph_hwsku"],
15891590
"basicParams": {
@@ -1593,9 +1594,15 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
15931594
).vars['ansible_host'],
15941595
"port_map_file": ptf_portmap_file,
15951596
"sonic_asic_type": duthost.facts['asic_type'],
1596-
"sonic_version": duthost.os_version
1597+
"sonic_version": duthost.os_version,
1598+
"dut_username": creds['sonicadmin_user'],
1599+
"dut_password": creds['sonicadmin_password']
15971600
}
15981601
}
1602+
if 'platform_asic' in duthost.facts:
1603+
rtn_dict['basicParams']["platform_asic"] = duthost.facts['platform_asic']
1604+
1605+
yield rtn_dict
15991606

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

0 commit comments

Comments
 (0)