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
@@ -38,11 +38,6 @@ func TestDmesgSeverity_xidCodes(t *testing.T) {
msg: "Yama: disabled by default; enable with sysctl kernel.yama.*",
want: statusWarning,
},
{
name: "benign NVRM driver load message still escalates via NVRM keyword",
msg: "NVRM: loading NVIDIA UNIX Open Kernel Module for x86_64 580.159.03",
want: statusCritical,
},
}
for _, tt := range tests {
@@ -54,3 +49,12 @@ func TestDmesgSeverity_xidCodes(t *testing.T) {
})
}
}
func TestParseDmesgErrorsSkipsKnownBootNoise(t *testing.T) {
entries := parseDmesgErrors("[Thu Aug 25 10:00:00 2026] pci 0000:00:02.0: bridge window [mem 0x0000-0x0000] to [bus 01-ff] failed to assign\n" +
"[Thu Aug 25 10:00:01 2026] NVRM: loading NVIDIA UNIX Open Kernel Module for x86_64\n" +
"[Thu Aug 25 10:00:02 2026] blk_update_request: I/O error, dev sda\n")
if len(entries) != 1 || entries[0].Severity == nil || *entries[0].Severity != statusCritical {
t.Fatalf("entries=%#v, want one critical real error", entries)
}
}