fix(redfish): read PCIeInterface link width for GPU PCIe devices
parseGPUWithSupplementalDocs did not read PCIeInterface from the device doc, only from function docs. xFusion GPU PCIeCard entries carry link width/speed in PCIeInterface (LanesInUse/Maxlanes/PCIeType/MaxPCIeType) so GPU link width was always empty for xFusion servers. Also apply the xFusion OEM function-level fallback for GPU function docs, consistent with the NIC and PCIeDevice paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2815,6 +2815,28 @@ func TestReplayCollectGPUs_DedupUsesRedfishPathBeforeHeuristics(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseGPU_xFusionPCIeInterfaceMaxlanes(t *testing.T) {
|
||||
// xFusion GPU PCIeDevices (PCIeCard1..N) carry link width in PCIeInterface
|
||||
// with "Maxlanes" (lowercase 'l') rather than "MaxLanes".
|
||||
doc := map[string]interface{}{
|
||||
"Id": "PCIeCard1",
|
||||
"Model": "RTX PRO 6000",
|
||||
"PCIeInterface": map[string]interface{}{
|
||||
"LanesInUse": 16,
|
||||
"Maxlanes": 16,
|
||||
"PCIeType": "Gen5",
|
||||
"MaxPCIeType": "Gen5",
|
||||
},
|
||||
}
|
||||
gpu := parseGPU(doc, nil, 1)
|
||||
if gpu.CurrentLinkWidth != 16 || gpu.MaxLinkWidth != 16 {
|
||||
t.Fatalf("expected link widths 16/16 from PCIeInterface, got current=%d max=%d", gpu.CurrentLinkWidth, gpu.MaxLinkWidth)
|
||||
}
|
||||
if gpu.CurrentLinkSpeed != "Gen5" || gpu.MaxLinkSpeed != "Gen5" {
|
||||
t.Fatalf("expected link speeds Gen5/Gen5 from PCIeInterface, got current=%q max=%q", gpu.CurrentLinkSpeed, gpu.MaxLinkSpeed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseGPU_UsesNestedOemSerialNumber(t *testing.T) {
|
||||
doc := map[string]interface{}{
|
||||
"Id": "GPU4",
|
||||
|
||||
Reference in New Issue
Block a user