Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Fix dynamic minimum fan table issue caused by python3 #53

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def is_match(self, thermal_info_dict):

trust_state = Thermal.check_module_temperature_trustable()
temperature = Thermal.get_min_amb_temperature()
temperature = temperature / 1000
temperature = int(temperature / 1000)

change_cooling_level = False
if trust_state != MinCoolingLevelChangeCondition.trust_state:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_dynamic_minimum_policy(thermal_manager):
condition = policy.conditions[MinCoolingLevelChangeCondition]
action = policy.actions[ChangeMinCoolingLevelAction]
Thermal.check_module_temperature_trustable = MagicMock(return_value='trust')
Thermal.get_min_amb_temperature = MagicMock(return_value=35000)
Thermal.get_min_amb_temperature = MagicMock(return_value=35001)
assert condition.is_match(None)
assert MinCoolingLevelChangeCondition.trust_state == 'trust'
assert MinCoolingLevelChangeCondition.temperature == 35
Expand All @@ -492,7 +492,7 @@ def test_dynamic_minimum_policy(thermal_manager):
assert condition.is_match(None)
assert MinCoolingLevelChangeCondition.trust_state == 'untrust'

Thermal.get_min_amb_temperature = MagicMock(return_value=25000)
Thermal.get_min_amb_temperature = MagicMock(return_value=25999)
assert condition.is_match(None)
assert MinCoolingLevelChangeCondition.temperature == 25

Expand Down