Skip to content
11 changes: 10 additions & 1 deletion tests/platform/mellanox/check_hw_mgmt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import logging
import re
import time

from common.utilities import wait_until

Expand All @@ -20,7 +21,15 @@ def check_hw_management_service(dut):
"""This function is to check the hw management service and related settings.
"""
logging.info("Check fan speed setting")
assert not wait_until_fan_speed_set_to_default(dut), \
# In current hw-mgmt implementation, it set the fan speed to default
# value when suspending thermal control algorithm, but it takes some time
# to take effect. During this period, algorithm could change speed value
# back and hw-mgmt will set it to default again, so it's possible that
# although at some point the speed value is default but it could be changed
# after some time. So we just wait for 300 secs to make sure fan speed is
# set to default value instead of check every 10s.
time.sleep(300)
assert fan_speed_set_to_default(dut), \
"Fan speed is not default to 60 percent in 5 minutes. 153/255=60%"

logging.info("Check service status using systemctl")
Expand Down