From 0ae12a32bdfc67bebdac0d357e9b491783ca6ee1 Mon Sep 17 00:00:00 2001 From: junchao Date: Mon, 30 Aug 2021 14:12:49 +0800 Subject: [PATCH] [Mellanox] Read PSU fan max/min speed per PSU Change-Id: I6dc3980965fdfc377053a23fd6c721b301fc9a01 --- .../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 765d744f4a2..9cd5cda7a2a 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