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:
4 files changed
+38
-14
No files matched your search
@@ -281,3 +281,17 @@ def test_build_environment_from_new_resources(rackmount):
|
||||
def test_build_environment_empty():
|
||||
assert build_environment() == {
|
||||
"fans": {}, "temperature": {}, "power": {}, "voltages": {}, "consumed_watts": None}
|
||||
|
||||
|
||||
def test_power_supply_legacy_item(rackmount):
|
||||
# Items of the legacy Power.PowerSupplies array parse the same way: MemberId as id,
|
||||
# LastPowerOutputWatts as output.
|
||||
(item,) = rackmount(CHASSIS + "/Power")["PowerSupplies"]
|
||||
psu = parse_power_supply(item)
|
||||
assert psu["id"] == "0"
|
||||
assert psu["name"] == "Power Supply Bay"
|
||||
assert psu["capacity"] == 800.0
|
||||
assert psu["output"] == 325.0
|
||||
assert psu["model"] == "499253-B21"
|
||||
assert psu["serial_number"] == "1Z0000001"
|
||||
assert psu["status"] is False
|
||||
Reference in new issue
Block a user