Skip to content

Commit eccc12e

Browse files
committed
Use inventory for raid details instead of BMC
We now have full raid controller details available after redfish inspection so there is no need to probe the BMC for them. We also update the business logic to group disks by size, to avoid building RAID arrays out of mismatched disks.
1 parent daa3a2f commit eccc12e

4 files changed

Lines changed: 554 additions & 58 deletions

File tree

python/understack-workflows/tests/test_enroll_server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def make_node_inventory(
3333
interfaces: list[dict] | None = None,
3434
connected_interface_names: list[str] | None = None,
3535
serial_number: str = "FL6PC14",
36+
storage_controllers: list[dict] | None = None,
3637
) -> dict:
3738
"""Build a realistic Ironic node inventory dict, suitable for mocking."""
3839
if interfaces is None:
@@ -56,6 +57,7 @@ def make_node_inventory(
5657
return {
5758
"inventory": {
5859
"interfaces": interfaces,
60+
"storage_controllers": storage_controllers or [],
5961
"system_vendor": {
6062
"product_name": "PowerEdge R7615",
6163
"serial_number": serial_number,
@@ -179,6 +181,15 @@ def test_enrol_happy_path_uses_virtual_media_inspect_and_flips_back(mocker):
179181
fake_bmc = make_bmc(mocker, fake_sushy=make_raid_hardware())
180182
inventory = make_node_inventory(
181183
connected_interface_names=["NIC.Integrated.1-1", "NIC.Integrated.1-2"],
184+
storage_controllers=[
185+
{
186+
"id": "RAID.Integrated.1-1",
187+
"drives": [
188+
{"id": "Disk1", "size": 479559942144},
189+
{"id": "Disk2", "size": 479559942144},
190+
],
191+
}
192+
],
182193
)
183194
# port-enroll-config hook has run during agent inspection and flagged
184195
# pxe_enabled on LLDP-connected ports. port-bios-name (OOB) stamped

0 commit comments

Comments
 (0)