From 1f174fa4eac0fc9e40f84574e2d2f4156887b27d Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Sun, 12 Sep 2021 15:43:32 +0800 Subject: [PATCH] [Mellanox] Read PSU fan max/min speed per PSU (#4144) Align with PR Azure/sonic-buildimage#8563 - How did you do it? Read PSU fan max/min speed per PSU - How did you verify/test it? Manually run test case test_platform_info::test_show_platform_fanstatus_mocked - Any platform specific information? Mellanox --- .../mellanox/mellanox_thermal_control_test_helper.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py b/tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py index b08b203ff94..b6f4a3401bd 100644 --- a/tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py +++ b/tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py @@ -88,7 +88,7 @@ "name": "psu{}_fan1", "speed": "psu{}_fan1_speed_get", "power_status": "psu{}_pwr_status", - "max_speed": "psu_fan_max", + "max_speed": "psu{}_fan_max", } } @@ -551,10 +551,7 @@ def get_max_speed(self): :return: Max speed of this FAN or -1 if max speed is not available. """ if self.max_speed_file: - if 'psu' not in self.max_speed_file: - max_speed = self.helper.read_thermal_value(self.max_speed_file) - else: - max_speed = self.helper.read_value(os.path.join('/run/hw-management/config', self.max_speed_file)) + max_speed = self.helper.read_thermal_value(self.max_speed_file) return int(max_speed) else: return -1