Extend parsers for the driver

parse_power_supply also reads items of the legacy Power.PowerSupplies array, parse_ethernet_interface exposes the raw LinkStatus, and parse_network_protocol reports protocols that carry a Port without a ProtocolEnabled flag.
This commit is contained in:
Christian Manivong committed 2026-10-13 05:02:58 +00:00
1 parent 8b512b6e0d
commit 209537a793
4 files changed
+38 -14

No files matched your search

+7
View File
@@ -57,6 +57,7 @@ def test_ethernet_interface(rackmount):
assert eth["fqdn"] == "web483-bmc.dmtf.org"
assert eth["vlan"] == 101
assert eth["permanent_mac_address"] == "23:11:8A:33:CF:EA"
assert eth["link_status"] == "LinkUp"
def test_ethernet_interface_without_link_status(rackmount):
@@ -64,6 +65,7 @@ def test_ethernet_interface_without_link_status(rackmount):
eth = parse_ethernet_interface(rackmount(MANAGER + "/EthernetInterfaces/ToHost"))
assert eth["interface"]["is_up"] is True
assert eth["ipv4"] == {"192.168.20.55": {"prefix_length": 24}}
assert eth["link_status"] is None
assert eth["vlan"] is None
@@ -151,6 +153,11 @@ def test_network_protocol_ntp(telemetry):
"communities": []}
def test_network_protocol_port_without_flag():
np = parse_network_protocol({"IPMI": {"Port": 623}, "Proxy": {"Enabled": True}})
assert np["protocols"] == {"IPMI": {"enabled": None, "port": 623}}
def test_network_protocol_ntp_blank_entries():
servers = ["", None, " pool.ntp.org ", "pool.ntp.org"]
np = parse_network_protocol({"NTP": {"ProtocolEnabled": True, "NTPServers": servers}})