Skip to content

Commit 8ef7e18

Browse files
feat: Restore missing platform configurations (HI176, HI177, HI179, HI180)
Add 4 platforms dropped during refactoring. Fixes GB200/GB3000 support. Also remove duplicate hw-management-fast-sysfs-monitor in debian/rules. Ticket: #4761522 Signed-off-by: Abraham Coifman <[email protected]>
1 parent 8c7c3c2 commit 8ef7e18

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

debian/rules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ override_dh_systemd_start:
8181
dh_systemd_start --name=hw-management-sysfs-monitor
8282
dh_systemd_start --name=hw-management-fast-sysfs-monitor
8383
dh_systemd_start --name=hw-management-blacklist-generator
84-
dh_systemd_start --name=hw-management-fast-sysfs-monitor
8584

8685
override_dh_strip_nondeterminism:
8786

tests/offline/test_hw_management_redfish_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ class TestBMCAccessorInitialization:
407407
def test_simple_constants(self):
408408
"""Simple: Verify BMCAccessor constants"""
409409
assert BMCAccessor.CURL_PATH == '/usr/bin/curl'
410-
assert BMCAccessor.BMC_INTERNAL_IP_ADDR == '10.0.1.1'
411410
assert BMCAccessor.BMC_ADMIN_ACCOUNT == 'admin'
412411
assert BMCAccessor.BMC_DEFAULT_PASSWORD == '0penBmc'
413412

@@ -424,16 +423,17 @@ class TestBMCAccessorGetIPAddr:
424423
"""Tests for get_ip_addr() method"""
425424

426425
def test_simple_default_ip(self, mock_subprocess):
427-
"""Simple: Return default IP when redis fails"""
426+
"""Simple: Return default IP when usb0 detection fails"""
428427
mock_subprocess.run.return_value = MagicMock(returncode=1, stdout='', stderr='')
429428

430429
with patch.object(BMCAccessor, 'get_login_password', return_value='****'):
431430
accessor = BMCAccessor()
432431
ip = accessor.get_ip_addr()
433-
assert ip == BMCAccessor.BMC_INTERNAL_IP_ADDR
432+
assert ip == "0.0.0.0"
434433

435-
def test_medium_redis_ip(self, mock_subprocess):
436-
"""Medium: Return IP from redis"""
434+
def test_medium_usb0_ip(self, mock_subprocess):
435+
"""Medium: Return BMC IP derived from usb0 interface"""
436+
# Simulate usb0 IP: 192.168.1.100 -> BMC IP: 192.168.1.1
437437
mock_subprocess.run.return_value = MagicMock(
438438
returncode=0,
439439
stdout='192.168.1.100\n',
@@ -443,7 +443,7 @@ def test_medium_redis_ip(self, mock_subprocess):
443443
with patch.object(BMCAccessor, 'get_login_password', return_value='****'):
444444
accessor = BMCAccessor()
445445
ip = accessor.get_ip_addr()
446-
assert ip == '192.168.1.100'
446+
assert ip == '192.168.1.1' # Last byte replaced with '1'
447447

448448

449449
class TestBMCAccessorPasswordGeneration:

usr/usr/bin/hw_management_platform_config.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,32 @@
154154
{'fin': None, 'fn': 'monitor_asic_chipup_status', 'poll': 5, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}}},
155155
{'fin': None, 'fn': 'module_temp_populate', 'poll': 20, 'ts': 0, 'arg': {'fin': '/sys/module/sx_core/asic0/module{}/', 'fout_idx_offset': 1, 'module_count': 24}},
156156
],
157+
"HI176": [
158+
{'fin': '/var/run/hw-management/system/graceful_pwr_off', 'fn': 'run_power_button_event', 'arg': [], 'poll': 1, 'ts': 0},
159+
{'fin': None, 'fn': 'asic_temp_populate', 'poll': 3, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}}},
160+
{'fin': None, 'fn': 'monitor_asic_chipup_status', 'poll': 5, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}}},
161+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage1', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE1 {arg1}'], 'poll': 2, 'ts': 0},
162+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage2', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE2 {arg1}'], 'poll': 2, 'ts': 0},
163+
{'fin': None, 'fn': 'redfish_get_sensor', 'arg': ['/redfish/v1/Chassis/MGX_BMC_0/Sensors/BMC_TEMP', 'bmc', 1000], 'poll': 30, 'ts': 0},
164+
],
165+
"HI177": [
166+
{'fin': '/var/run/hw-management/system/graceful_pwr_off', 'fn': 'run_power_button_event', 'arg': [], 'poll': 1, 'ts': 0},
167+
{'fin': None, 'fn': 'asic_temp_populate', 'poll': 3, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}, 'asic3': {'fin': '/sys/module/sx_core/asic2/'}}},
168+
{'fin': None, 'fn': 'monitor_asic_chipup_status', 'poll': 5, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}, 'asic3': {'fin': '/sys/module/sx_core/asic2/'}}},
169+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage1', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE1 {arg1}'], 'poll': 2, 'ts': 0},
170+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage2', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE2 {arg1}'], 'poll': 2, 'ts': 0},
171+
{'fin': None, 'fn': 'redfish_get_sensor', 'arg': ['/redfish/v1/Chassis/MGX_BMC_0/Sensors/BMC_TEMP', 'bmc', 1000], 'poll': 30, 'ts': 0},
172+
],
173+
"HI179": [
174+
{'fin': None, 'fn': 'asic_temp_populate', 'poll': 3, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}, 'asic3': {'fin': '/sys/module/sx_core/asic2/'}, 'asic4': {'fin': '/sys/module/sx_core/asic3/'}}},
175+
{'fin': None, 'fn': 'monitor_asic_chipup_status', 'poll': 5, 'ts': 0, 'arg': {'asic': {'fin': '/sys/module/sx_core/asic0/'}, 'asic1': {'fin': '/sys/module/sx_core/asic0/'}, 'asic2': {'fin': '/sys/module/sx_core/asic1/'}, 'asic3': {'fin': '/sys/module/sx_core/asic2/'}, 'asic4': {'fin': '/sys/module/sx_core/asic3/'}}},
176+
{'fin': None, 'fn': 'module_temp_populate', 'poll': 20, 'ts': 0, 'arg': {'fin': '/sys/module/sx_core/asic0/module{}/', 'fout_idx_offset': 1, 'module_count': 73}},
177+
],
178+
"HI180": [
179+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage1', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE1 {arg1}'], 'poll': 2, 'ts': 0},
180+
{'fin': '/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage2', 'fn': 'run_cmd', 'arg': ['/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE2 {arg1}'], 'poll': 2, 'ts': 0},
181+
{'fin': '/var/run/hw-management/system/graceful_pwr_off', 'fn': 'run_power_button_event', 'arg': [], 'poll': 1, 'ts': 0},
182+
],
157183
"HI181": [
158184
{"fin": "/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage1", "fn": "run_cmd", "arg": ["/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE1 {arg1}"], "poll": 2, "ts": 0},
159185
{"fin": "/sys/devices/platform/mlxplat/mlxreg-io/hwmon/{hwmon}/leakage2", "fn": "run_cmd", "arg": ["/usr/bin/hw-management-chassis-events.sh hotplug-event LEAKAGE2 {arg1}"], "poll": 2, "ts": 0},

0 commit comments

Comments
 (0)