Skip to content

Commit

Permalink
chore: skip PSU check for chassis LC (#16057)
Browse files Browse the repository at this point in the history
Description of PR
Skip platform_tests/test_platform_info.py::test_turn_on_off_psu_and_check_psustatus for chassis LC

Summary:
Fixes # (issue) Microsoft ADO 30114143

Approach
What is the motivation for this PR?
Due to the module-level enumerate fixture psu_test_setup_teardown that has enum_rand_one_per_hwsku_hostname in this test module, we will run platform_tests/test_platform_info.py::test_turn_on_off_psu_and_check_psustatus multiple times when it's a T2 chassis. However, we don't need to run it multiple times because we are just toggling the PDU/PSU on the supervisor card in this test case. Therefore, we should skip the runs when the parametrization is on LCs.

How did you do it?
How did you verify/test it?
Ran it on T2 and I can confirm it's only run for supervisor parametrization.

Any platform specific information?
Supported testbed topology if it's a new test case?

co-authorized by: [email protected]
  • Loading branch information
cyw233 authored Dec 13, 2024
1 parent 4cfaddd commit 2c28912
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/platform_tests/test_platform_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,16 @@ def check_all_psu_on(dut, psu_test_results):

@pytest.mark.disable_loganalyzer
@pytest.mark.parametrize('ignore_particular_error_log', [SKIP_ERROR_LOG_PSU_ABSENCE], indirect=True)
def test_turn_on_off_psu_and_check_psustatus(duthosts,
def test_turn_on_off_psu_and_check_psustatus(duthosts, enum_rand_one_per_hwsku_hostname,
get_pdu_controller, ignore_particular_error_log, tbinfo):
"""
@summary: Turn off/on PSU and check PSU status using 'show platform psustatus'
"""
duthost = get_sup_node_or_random_node(duthosts)
is_modular_chassis = duthosts[0].get_facts().get("modular_chassis")
if is_modular_chassis and not duthosts[enum_rand_one_per_hwsku_hostname].is_supervisor_node():
pytest.skip("Skip the PSU check test on Line card on modular chassis")

duthost = get_sup_node_or_random_node(duthosts)
psu_line_pattern = get_dut_psu_line_pattern(duthost)

psu_num = get_healthy_psu_num(duthost)
Expand Down Expand Up @@ -277,7 +280,6 @@ def test_turn_on_off_psu_and_check_psustatus(duthosts,

# Increase pdu_wait_time for modular chassis
pdu_wait_time = PDU_WAIT_TIME
is_modular_chassis = duthosts[0].get_facts().get("modular_chassis")
if is_modular_chassis:
pdu_wait_time = MODULAR_CHASSIS_PDU_WAIT_TIME

Expand Down

0 comments on commit 2c28912

Please sign in to comment.