perf(redfish): bound Giga B300 inventory crawl

This commit is contained in:
Mikhail Chusavitin committed 2026-09-28 18:48:55 +03:00
1 parent 3ac19f37b8
commit 29371f69ee
9 files changed
+432 -6

No files matched your search

@@ -260,6 +260,69 @@ func TestBuildAcquisitionPlan_Fixture_AMI_Generic(t *testing.T) {
}
}
func TestBuildAcquisitionPlan_Fixture_Giga_G894_B300(t *testing.T) {
signals := loadProfileFixtureSignals(t, "giga-g894-b300.json")
match := MatchProfiles(signals)
plan := BuildAcquisitionPlan(signals)
resolved := ResolveAcquisitionPlan(match, plan, discoveredResourcesFromSignals(signals), signals)
if match.Mode != ModeMatched {
t.Fatalf("expected matched mode, got %q", match.Mode)
}
assertProfileSelected(t, match, "giga-ast2600")
assertProfileSelected(t, match, "ami-family")
assertProfileSelected(t, match, "hgx-topology")
assertProfileNotSelected(t, match, "supermicro")
if plan.Tuning.SnapshotMaxDocuments != 12000 {
t.Fatalf("expected bounded Giga B300 snapshot cap, got %d", plan.Tuning.SnapshotMaxDocuments)
}
if plan.Tuning.PostProbePolicy.EnableNumericCollectionProbe {
t.Fatal("expected Giga B300 to disable numeric collection probing")
}
if plan.Tuning.RecoveryPolicy.EnableCriticalSlowProbe {
t.Fatal("expected Giga B300 to disable slow critical probing")
}
if plan.Tuning.RecoveryPolicy.EnableEmptyCriticalCollectionRetry {
t.Fatal("expected Giga B300 to disable empty collection retry")
}
if plan.Tuning.RecoveryPolicy.EnableProfilePlanB {
t.Fatal("expected Giga B300 to disable profile plan-B")
}
for _, want := range []string{
"/Fabrics",
"/TrustedComponents",
"/Oem/NvidiaRoT/RoTProtectedComponents",
"/Certificates",
"/Metrics",
} {
if !containsString(plan.Tuning.SnapshotExcludeContains, want) {
t.Fatalf("expected snapshot exclusion %q, got %v", want, plan.Tuning.SnapshotExcludeContains)
}
}
if !containsString(resolved.SeedPaths, "/redfish/v1/Systems/HGX_Baseboard_0/Processors") {
t.Fatal("expected HGX processor inventory seed")
}
if !containsString(resolved.SeedPaths, "/redfish/v1/Systems/HGX_Baseboard_0/Memory") {
t.Fatal("expected HGX memory inventory seed")
}
for _, unwanted := range []string{
"/redfish/v1/Systems/HGX_Baseboard_0/PCIeDevices",
"/redfish/v1/Systems/HGX_Baseboard_0/Storage",
"/redfish/v1/Systems/HGX_Baseboard_0/Bios",
"/redfish/v1/Chassis/HGX_GPU_0/Oem/Public",
"/redfish/v1/Chassis/HGX_GPU_0/Power",
} {
if containsString(resolved.CriticalPaths, unwanted) || containsString(resolved.SeedPaths, unwanted) {
t.Fatalf("did not expect guessed Giga B300 path %q", unwanted)
}
}
if !containsString(resolved.SeedPaths, "/redfish/v1/Systems/Self/Storage") {
t.Fatal("expected host storage inventory to remain in the plan")
}
}
func TestBuildAcquisitionPlan_Fixture_UnknownVendor(t *testing.T) {
signals := loadProfileFixtureSignals(t, "unknown-vendor.json")
match := MatchProfiles(signals)