Skip to content
Merged
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
19 changes: 3 additions & 16 deletions tests/common/helpers/thermal_control_test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,9 @@ def restart_thermal_control_daemon(dut):
output = dut.shell(find_thermalctld_pid_cmd)

assert output["rc"] == 0, "Run command '{}' failed".format(find_thermalctld_pid_cmd)
# Usually there should be 2 thermalctld processes, but there is chance that
# sonic platform API might use subprocess which creates extra thermalctld process.
# For example, chassis.get_all_sfps will call sfp constructor, and sfp constructor may
# use subprocess to call ethtool to do initialization.
# So we check here thermalcltd must have at least 2 processes.
# For mellanox, it has at least two processes, but for celestica(broadcom),
# it only has one thermalctld process
# For kvm, there is no thermalctld process
if dut.facts["asic_type"] == "mellanox":
assert len(output["stdout_lines"]
) >= 2, "There should be at least 2 thermalctld process"
elif dut.facts["asic_type"] == "vs":
if dut.facts["asic_type"] == "vs":
assert len(output["stdout_lines"]) == 0, "There should be 0 thermalctld process"
else:
assert len(output["stdout_lines"]
Expand All @@ -307,12 +298,8 @@ def restart_thermal_control_daemon(dut):
output = dut.shell(find_thermalctld_pid_cmd)
assert output["rc"] == 0, "Run command '{}' failed after restart of thermalctld on {}".format(
find_thermalctld_pid_cmd, dut.hostname)
if dut.facts["asic_type"] == "mellanox":
assert len(
output["stdout_lines"]) >= 2, "There should be at least 2 thermalctld process"
else:
assert len(
output["stdout_lines"]) >= 1, "There should be at least 1 thermalctld process"
assert len(
output["stdout_lines"]) >= 1, "There should be at least 1 thermalctld process"
logging.info(
"thermalctld processes restarted successfully on {}".format(dut.hostname))
return
Expand Down
Loading