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
15 changes: 10 additions & 5 deletions tests/common/fixtures/duthost_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,21 @@ def dut_qos_maps(rand_selected_dut):
"""
maps = {}
try:
if rand_selected_dut.is_multi_asic:
sonic_cfggen_cmd = "sonic-cfggen -n asic0 -d --var-json"
else:
sonic_cfggen_cmd = "sonic-cfggen -d --var-json"

# port_qos_map
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'PORT_QOS_MAP'")['stdout'])
maps['port_qos_map'] = json.loads(rand_selected_dut.shell("{} 'PORT_QOS_MAP'".format(sonic_cfggen_cmd))['stdout'])
# dscp_to_tc_map
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'DSCP_TO_TC_MAP'")['stdout'])
maps['dscp_to_tc_map'] = json.loads(rand_selected_dut.shell("{} 'DSCP_TO_TC_MAP'".format(sonic_cfggen_cmd))['stdout'])
# tc_to_queue_map
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_QUEUE_MAP'")['stdout'])
maps['tc_to_queue_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_QUEUE_MAP'".format(sonic_cfggen_cmd))['stdout'])
# tc_to_priority_group_map
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_PRIORITY_GROUP_MAP'")['stdout'])
maps['tc_to_priority_group_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_PRIORITY_GROUP_MAP'".format(sonic_cfggen_cmd))['stdout'])
# tc_to_dscp_map
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("sonic-cfggen -d --var-json 'TC_TO_DSCP_MAP'")['stdout'])
maps['tc_to_dscp_map'] = json.loads(rand_selected_dut.shell("{} 'TC_TO_DSCP_MAP'".format(sonic_cfggen_cmd))['stdout'])
except:
pass
return maps
Expand Down
7 changes: 6 additions & 1 deletion tests/common/fixtures/ptfhost_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _ptf_portmap_file(duthost, ptfhost, tbinfo):
filename (str): returns the filename copied to PTF host
"""
intfInfo = duthost.show_interface(command = "status")['ansible_facts']['int_status']
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up']
portList = [port for port in intfInfo if port.startswith('Ethernet') and intfInfo[port]['oper_state'] == 'up' and intfInfo[port]['admin_state'] == 'up']
mg_facts = duthost.get_extended_minigraph_facts(tbinfo)
portMapFile = "/tmp/default_interface_to_front_map.ini"
with open(portMapFile, 'w') as file:
Expand Down Expand Up @@ -520,11 +520,16 @@ def ptf_test_port_map_active_active(ptfhost, tbinfo, duthosts, mux_server_url, d
if target_dut_port in mg_facts['minigraph_port_indices'].values():
router_mac = duts_running_config_facts[duthosts[target_dut_index].hostname][idx]['DEVICE_METADATA']['localhost']['mac'].lower()
asic_idx = idx
for a_dut_port, a_dut_port_index in mg_facts['minigraph_port_indices'].items():
if a_dut_port_index == target_dut_port and "Ethernet-Rec" not in a_dut_port and \
"Ethernet-IB" not in a_dut_port and "Ethernet-BP" not in a_dut_port:
dut_port = a_dut_port
break
ports_map[ptf_port] = {
'target_dut': [target_dut_index],
'target_dest_mac': router_mac,
'target_src_mac': [router_mac],
'dut_port': dut_port,
'asic_idx': asic_idx
}

Expand Down
16 changes: 16 additions & 0 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ qos/test_buffer_traditional.py:
conditions:
- "is_multi_asic==True or release not in ['201911']"

qos/test_buffer.py:
skip:
reason: "Tests are relevant to dynamic buffering not required on T2"
conditions:
- "'t2' in topo_name"

qos/test_pfc_pause.py::test_pfc_pause_lossless:
# For this test, we use the fanout connected to the DUT to send PFC pause frames.
# The fanout needs to send PFC frames fast enough so that the queue remains completely paused for the entire duration
Expand Down Expand Up @@ -723,10 +729,20 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:

qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:
skip:
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
conditions:
- "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']"
xfail:
reason: "Headroom pool size not supported."
conditions:
- "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']"

qos/test_qos_sai.py::TestQosSai::testQosSaiBufferPoolWatermark:
skip:
reason: "sai_thrift_read_buffer_pool_watermark are not supported on DNX"
conditions:
- "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']"

qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
skip:
reason: "PG drop size test is not supported."
Expand Down
11 changes: 8 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ def duts_running_config_facts(duthosts):

@pytest.fixture(scope='class')
def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
ptf_portmap_file, lower_tor_host): # noqa F811
ptf_portmap_file, lower_tor_host, creds): # noqa F811
"""
Prepares DUT host test params

Expand All @@ -1653,7 +1653,7 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
mgFacts = duthost.get_extended_minigraph_facts(tbinfo)
topo = tbinfo["topo"]["name"]

yield {
rtn_dict = {
"topo": topo,
"hwsku": mgFacts["minigraph_hwsku"],
"basicParams": {
Expand All @@ -1663,10 +1663,15 @@ def dut_test_params(duthosts, enum_rand_one_per_hwsku_frontend_hostname, tbinfo,
).vars['ansible_host'],
"port_map_file": ptf_portmap_file,
"sonic_asic_type": duthost.facts['asic_type'],
"sonic_version": duthost.os_version
"sonic_version": duthost.os_version,
"dut_username": creds['sonicadmin_user'],
"dut_password": creds['sonicadmin_password']
}
}
if 'platform_asic' in duthost.facts:
rtn_dict['basicParams']["platform_asic"] = duthost.facts['platform_asic']

yield rtn_dict

@pytest.fixture(scope='module')
def duts_minigraph_facts(duthosts, tbinfo):
Expand Down
Loading