webui/collector: strip ANSI escapes in nvidia-smi topo parsing, auto-prepare drives for RAID mirror creation
- nvidia-smi underlines the topo -m header with ANSI CSI codes even when writing to a file; both NVLink matrix parsers failed to find the header and /topo showed "No NVLink-bonded GPU pairs found" on bonded systems. - raid-lsi-create-mirror failed with "resources already in use" (exit 11) on JBOD drives; the task now reads drive states and auto-converts JBOD/UBad (set good force), releases hotspares, refuses Frgn/Onln with actionable messages, and dumps preservedcache info when add vd fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,3 +82,22 @@ func TestParseStorcliResponseDataDrivesPerSlotKeys(t *testing.T) {
|
||||
t.Fatalf("free=%d want 1 (JBOD is a free drive)", len(free))
|
||||
}
|
||||
}
|
||||
|
||||
func TestClassifyRAIDPrepareAction(t *testing.T) {
|
||||
cases := map[string]raidPrepareAction{
|
||||
"UGood": raidPrepNone,
|
||||
"": raidPrepNone,
|
||||
"JBOD": raidPrepSetGood,
|
||||
"UBad": raidPrepSetGood,
|
||||
"GHS": raidPrepHotspare,
|
||||
"DHS": raidPrepHotspare,
|
||||
"Frgn": raidPrepBlockedFrgn,
|
||||
"Onln": raidPrepBlockedOnln,
|
||||
"Offln": raidPrepBlockedOnln,
|
||||
}
|
||||
for state, want := range cases {
|
||||
if got := classifyRAIDPrepareAction(state); got != want {
|
||||
t.Errorf("state %q: got %v want %v", state, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user