Add parsers for the Redfish resources in redfish-map.md

Pure functions for ServiceRoot, ComputerSystem (facts, power state, reset action and ActionInfo), Processors, Memory, Storage/Drives/SimpleStorage, Chassis Thermal and Power as well as ThermalSubsystem/PowerSubsystem/Sensors (with environment_sources to pick whichever exists), Manager, EthernetInterfaces, ManagerNetworkProtocol, accounts, firmware inventory and log services/entries.
This commit is contained in:
Christian Manivong committed 2026-10-12 23:42:14 +00:00
1 parent 8998e1342e
commit cab1c84cba
18 files changed
+1926

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
from napalm_redfish.parsers import parse_firmware
INVENTORY = "/redfish/v1/UpdateService/FirmwareInventory"
def test_firmware_bmc(rackmount):
fw = parse_firmware(rackmount(INVENTORY + "/BMC"))
assert fw == {
"id": "BMC",
"name": "Contoso BMC Firmware",
"version": "1.45.455b66-rev4",
"updateable": True,
"manufacturer": "Contoso",
"release_date": "2017-08-22T12:00:00Z",
"state": "Enabled",
"health": "OK",
"related": ["/redfish/v1/Managers/BMC"],
}
def test_firmware_bios(rackmount):
fw = parse_firmware(rackmount(INVENTORY + "/BIOS"))
assert fw["version"] == "P79 v1.45"
assert fw["related"] == ["/redfish/v1/Systems/437XR1138R2/Bios"]
def test_firmware_minimal():
fw = parse_firmware({"Id": "BMC", "Name": "BMC", "Version": "03.91"})
assert fw["version"] == "03.91"
assert fw["updateable"] is None
assert fw["related"] == []