fix: complete hardware collection diagnostics

This commit is contained in:
2026-08-25 17:04:33 +03:00
parent 33ace33de5
commit ccc781856e
19 changed files with 311 additions and 81 deletions
@@ -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