Skip to content

Commit

Permalink
Fix qos node selection for single-asic (#15074)
Browse files Browse the repository at this point in the history
Fix single-asic issues from PR #14925

The search for shortlink linecard logic added in that PR does not verify that a DUT
is multi-asic for the single_dut_multi_asic tests and incorrectly tries to access
the asics on a single-asic DUT.
  • Loading branch information
veronica-arista authored and mssonicbld committed Nov 15, 2024
1 parent e348574 commit 528ccfe
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,22 +634,28 @@ def select_src_dst_dut_and_asic(self, duthosts, request, tbinfo, lower_tor_host)
dst_asic_index = 0

elif test_port_selection_criteria == "single_dut_multi_asic":
found_multi_asic_dut = False
if topo in self.SUPPORTED_T0_TOPOS or isMellanoxDevice(duthost):
pytest.skip("single_dut_multi_asic is not supported on T0 topologies")
if topo not in self.SUPPORTED_T1_TOPOS and shortlink_indices:
src_dut_index = random.choice(shortlink_indices)
random.shuffle(shortlink_indices)
for idx in shortlink_indices:
a_dut = duthosts.frontend_nodes[idx]
if a_dut.sonichost.is_multi_asic:
src_dut_index = idx
found_multi_asic_dut = True
break
else:
found_multi_asic_dut = False
for a_dut_index in range(len(duthosts.frontend_nodes)):
a_dut = duthosts.frontend_nodes[a_dut_index]
if a_dut.sonichost.is_multi_asic:
src_dut_index = a_dut_index
found_multi_asic_dut = True
logger.info("Using dut {} for single_dut_multi_asic testing".format(a_dut.hostname))
break
if not found_multi_asic_dut:
pytest.skip(
"Did not find any frontend node that is multi-asic - so can't run single_dut_multi_asic tests")
if not found_multi_asic_dut:
pytest.skip(
"Did not find any frontend node that is multi-asic - so can't run single_dut_multi_asic tests")
dst_dut_index = src_dut_index
src_asic_index = 0
dst_asic_index = 1
Expand Down

0 comments on commit 528ccfe

Please sign in to comment.