-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few more things that are actually single links to a collection, rather than a collection of links. Signed-off-by: Sean McGinnis <[email protected]>
- Loading branch information
1 parent
145db18
commit 1b25a61
Showing
3 changed files
with
179 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,6 +124,151 @@ var storageBody = `{ | |
} | ||
}` | ||
|
||
var storageBodyDell = `{ | ||
"@odata.context": "/redfish/v1/$metadata#Storage.Storage", | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1", | ||
"@odata.type": "#Storage.v1_15_0.Storage", | ||
"Controllers": { | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1/Controllers" | ||
}, | ||
"Description": "Embedded AHCI 1", | ||
"Drives": [], | ||
"[email protected]": 0, | ||
"Id": "AHCI.Embedded.1-1", | ||
"Identifiers": [ | ||
{ | ||
"DurableName": null, | ||
"DurableNameFormat": null | ||
} | ||
], | ||
"[email protected]": 1, | ||
"Links": { | ||
"Enclosures": [ | ||
{ | ||
"@odata.id": "/redfish/v1/Chassis/System.Embedded.1" | ||
} | ||
], | ||
"[email protected]": 1, | ||
"Oem": { | ||
"Dell": { | ||
"@odata.type": "#DellOem.v1_3_0.DellOemLinks", | ||
"CPUAffinity": [], | ||
"[email protected]": 0 | ||
} | ||
}, | ||
"SimpleStorage": { | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/SimpleStorage/AHCI.Embedded.1-1" | ||
} | ||
}, | ||
"Name": "Sapphire Rapids SATA AHCI Controller", | ||
"Oem": { | ||
"Dell": { | ||
"@odata.type": "#DellOem.v1_3_0.DellOemResources", | ||
"DellController": { | ||
"@odata.context": "/redfish/v1/$metadata#DellController.DellController", | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1/Oem/Dell/DellControllers/AHCI.Embedded.1-1", | ||
"@odata.type": "#DellController.v1_4_1.DellController", | ||
"AlarmState": "AlarmNotPresent", | ||
"AutoConfigBehavior": "NotApplicable", | ||
"BootVirtualDiskFQDD": null, | ||
"CacheSizeInMB": 0, | ||
"CachecadeCapability": "NotSupported", | ||
"ConnectorCount": 0, | ||
"ControllerFirmwareVersion": null, | ||
"CurrentControllerMode": "NotSupported", | ||
"Description": "An instance of DellController will have RAID Controller specific data.", | ||
"Device": "0", | ||
"DeviceCardDataBusWidth": "Unknown", | ||
"DeviceCardSlotLength": "Unknown", | ||
"DeviceCardSlotType": "Unknown", | ||
"DriverVersion": null, | ||
"EncryptionCapability": "None", | ||
"EncryptionMode": "None", | ||
"Id": "AHCI.Embedded.1-1", | ||
"KeyID": null, | ||
"LastSystemInventoryTime": "2024-04-10T22:38:06+00:00", | ||
"LastUpdateTime": "2024-02-20T05:22:02+00:00", | ||
"MaxAvailablePCILinkSpeed": null, | ||
"MaxPossiblePCILinkSpeed": null, | ||
"Name": "DellController", | ||
"PCISlot": null, | ||
"PatrolReadState": "Unknown", | ||
"PersistentHotspare": "NotApplicable", | ||
"RealtimeCapability": "Incapable", | ||
"RollupStatus": "Unknown", | ||
"SASAddress": "0", | ||
"SecurityStatus": "EncryptionNotCapable", | ||
"SharedSlotAssignmentAllowed": "NotApplicable", | ||
"SlicedVDCapability": "NotSupported", | ||
"SupportControllerBootMode": "NotSupported", | ||
"SupportEnhancedAutoForeignImport": "NotSupported", | ||
"SupportRAID10UnevenSpans": "NotSupported", | ||
"SupportsLKMtoSEKMTransition": "No", | ||
"T10PICapability": "NotSupported" | ||
} | ||
} | ||
}, | ||
"Status": { | ||
"Health": null, | ||
"HealthRollup": null, | ||
"State": "Enabled" | ||
}, | ||
"StorageControllers": [ | ||
{ | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1#/StorageControllers/0", | ||
"Assembly": { | ||
"@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Assembly" | ||
}, | ||
"CacheSummary": { | ||
"TotalCacheSizeMiB": 0 | ||
}, | ||
"ControllerRates": { | ||
"ConsistencyCheckRatePercent": null, | ||
"RebuildRatePercent": null | ||
}, | ||
"FirmwareVersion": "", | ||
"Identifiers": [ | ||
{ | ||
"DurableName": null, | ||
"DurableNameFormat": null | ||
} | ||
], | ||
"[email protected]": 1, | ||
"Links": { | ||
"PCIeFunctions": [ | ||
{ | ||
"@odata.id": "/redfish/v1/Chassis/System.Embedded.1/PCIeDevices/0-24/PCIeFunctions/0-24-0" | ||
} | ||
], | ||
"[email protected]": 1 | ||
}, | ||
"Manufacturer": "DELL", | ||
"MemberId": "0", | ||
"Model": "Sapphire Rapids SATA AHCI Controller", | ||
"Name": "Sapphire Rapids SATA AHCI Controller", | ||
"SpeedGbps": null, | ||
"Status": { | ||
"Health": null, | ||
"HealthRollup": null, | ||
"State": "Enabled" | ||
}, | ||
"SupportedControllerProtocols": [ | ||
"PCIe" | ||
], | ||
"[email protected]": 1, | ||
"SupportedDeviceProtocols": [], | ||
"[email protected]": 0, | ||
"SupportedRAIDTypes": [], | ||
"[email protected]": 0 | ||
} | ||
], | ||
"[email protected]": "Please migrate to use /redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1/Controllers", | ||
"[email protected]": 1, | ||
"Volumes": { | ||
"@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1/Volumes" | ||
} | ||
}` | ||
|
||
// TestStorage tests the parsing of Storage objects. | ||
func TestStorage(t *testing.T) { | ||
var result Storage | ||
|
@@ -159,6 +304,15 @@ func TestStorage(t *testing.T) { | |
} | ||
} | ||
|
||
func TestStorageDell(t *testing.T) { | ||
var result Storage | ||
err := json.NewDecoder(strings.NewReader(storageBodyDell)).Decode(&result) | ||
|
||
if err != nil { | ||
t.Errorf("Error decoding JSON: %s", err) | ||
} | ||
} | ||
|
||
// TestStorageControllerUpdate tests the Update call. | ||
func TestStorageControllerUpdate(t *testing.T) { | ||
var result Storage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters