fix: complete hardware collection diagnostics
This commit is contained in:
@@ -6,6 +6,16 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAppendUniqueStorageMergesRAIDMetadataForSameDisk(t *testing.T) {
|
||||
serial, status, model, iface := "SN-1", "OK", "Disk Model", "SAS"
|
||||
base := []schema.HardwareStorage{{SerialNumber: &serial, HardwareComponentStatus: schema.HardwareComponentStatus{Status: &status}}}
|
||||
extra := []schema.HardwareStorage{{SerialNumber: &serial, Model: &model, Interface: &iface}}
|
||||
got := appendUniqueStorage(base, extra)
|
||||
if len(got) != 1 || got[0].Model == nil || *got[0].Model != model || got[0].Interface == nil || *got[0].Interface != iface {
|
||||
t.Fatalf("merged storage=%#v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseSASIrcuControllerIDs(t *testing.T) {
|
||||
raw := `LSI Corporation SAS2 IR Configuration Utility.
|
||||
Adapter List
|
||||
|
||||
Reference in New Issue
Block a user