Skip to content

Commit 18da1d4

Browse files
cyw233mssonicbld
authored andcommitted
chore: skip PSU check for chassis LC (#16057)
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]
1 parent f573d98 commit 18da1d4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/platform_tests/test_platform_info.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,16 @@ def check_all_psu_on(dut, psu_test_results):
241241

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

253+
duthost = get_sup_node_or_random_node(duthosts)
251254
psu_line_pattern = get_dut_psu_line_pattern(duthost)
252255

253256
psu_num = get_healthy_psu_num(duthost)
@@ -277,7 +280,6 @@ def test_turn_on_off_psu_and_check_psustatus(duthosts,
277280

278281
# Increase pdu_wait_time for modular chassis
279282
pdu_wait_time = PDU_WAIT_TIME
280-
is_modular_chassis = duthosts[0].get_facts().get("modular_chassis")
281283
if is_modular_chassis:
282284
pdu_wait_time = MODULAR_CHASSIS_PDU_WAIT_TIME
283285

0 commit comments

Comments
 (0)