Skip to content

Commit eebe8cb

Browse files
Fix issue: test case should be marked as failure if cannot get PSU fan speed (#3015)
Description of PR Summary: Test case should be marked as failure if cannot get PSU fan speed Approach What is the motivation for this PR? Test case should be marked as failure if cannot get PSU fan speed because it usually means that there is an issue with the sysfs. How did you do it? If PSU speed sysfs does not exist, assert false. How did you verify/test it? Manually run the test case Any platform specific information? Mellanox
1 parent 16919df commit eebe8cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/platform_tests/mellanox/test_thermal_control.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ def get_psu_speed(dut, index):
131131
index = index + 1
132132
psu_speed_path = PSU_SPEED_PATH.format(index)
133133
file_stat = dut.stat(path=psu_speed_path)
134-
if not file_stat["stat"]["exists"]:
135-
return None
134+
assert file_stat["stat"]["exists"], 'Failed to get PSU speed file due to {} does not exist'.format(psu_speed_path)
136135

137136
cmd_output = dut.command('cat {}'.format(psu_speed_path))
138137
try:

0 commit comments

Comments
 (0)