feat(audit): capture IPMI FRU/Elabel, mc info and LAN on every audit

The techdump — the only place the IPMI FRU / Elabel identity (Product Name
= server model, serials, part numbers) is recorded — only ran under LiveCD.
Run it on every audit so `bee audit` on an installed host captures it too.

Also add `ipmitool mc info` and `ipmitool lan print` to the techdump, and
pin `ipmitool fru print 0` to FRU device 0 to match the Export Tools
"FRU / Elabel" editor exactly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-09-03 15:18:01 +03:00
co-authored by Claude Sonnet 5
parent 319f08ac4b
commit 76db45ee95
4 changed files with 61 additions and 5 deletions
+26
View File
@@ -13,9 +13,35 @@ import (
"testing"
"bee/audit/internal/platform"
"bee/audit/internal/runtimeenv"
"bee/audit/internal/schema"
)
// TestRunAuditAlwaysCapturesTechnicalDump locks in that the raw techdump —
// the only place IPMI FRU / Elabel, mc info and LAN config are captured — is
// taken on every audit, not just under LiveCD as it used to be.
func TestRunAuditAlwaysCapturesTechnicalDump(t *testing.T) {
for _, mode := range []runtimeenv.Mode{runtimeenv.ModeLocal, runtimeenv.ModeLiveCD, runtimeenv.ModeAuto} {
mode := mode
t.Run(string(mode), func(t *testing.T) {
var dumped string
a := &App{
runtime: fakeRuntime{
collectFn: func(string) (schema.RuntimeHealth, error) { return schema.RuntimeHealth{}, nil },
dumpFn: func(dir string) error { dumped = dir; return nil },
},
}
out := filepath.Join(t.TempDir(), "audit.json")
if _, err := a.RunAudit(mode, "file:"+out); err != nil {
t.Fatalf("RunAudit(%s): %v", mode, err)
}
if dumped == "" {
t.Fatalf("RunAudit(%s) skipped the technical dump", mode)
}
})
}
}
type fakeNetwork struct {
listInterfacesFn func() ([]platform.InterfaceInfo, error)
defaultRouteFn func() string