Fix NVIDIA GPU/NVSwitch parsing and Reanimator export statuses
This commit is contained in:
56
internal/parser/vendors/nvidia/gpu_model_test.go
vendored
Normal file
56
internal/parser/vendors/nvidia/gpu_model_test.go
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
package nvidia
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
)
|
||||
|
||||
func TestApplyGPUModelsFromSKU(t *testing.T) {
|
||||
files := []parser.ExtractedFile{
|
||||
{
|
||||
Path: "inventory/fieldiag_summary.json",
|
||||
Content: []byte(`{
|
||||
"ModsRuns":[
|
||||
{"ModsHeader":[
|
||||
{"GpuName":"SXM5_SN_1653925025497","BoardInfo":"G520-0280"}
|
||||
]}
|
||||
]
|
||||
}`),
|
||||
},
|
||||
{
|
||||
Path: "testspec.json",
|
||||
Content: []byte(`{
|
||||
"actions":[
|
||||
{
|
||||
"virtual_id":"inventory",
|
||||
"args":{
|
||||
"sku_to_sku_json_file_map":{
|
||||
"G520-0280":"sku_hgx-h200-8-gpu_141g_aircooled_field.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}`),
|
||||
},
|
||||
}
|
||||
|
||||
result := &models.AnalysisResult{
|
||||
Hardware: &models.HardwareConfig{
|
||||
GPUs: []models.GPU{
|
||||
{
|
||||
Slot: "GPUSXM5",
|
||||
SerialNumber: "1653925025497",
|
||||
Model: "NVIDIA Device 2335",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
ApplyGPUModelsFromSKU(files, result)
|
||||
|
||||
if got := result.Hardware.GPUs[0].Model; got != "NVIDIA H200 SXM" {
|
||||
t.Fatalf("expected model NVIDIA H200 SXM, got %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user