package store import "testing" // R-266 (operator ruling 2026-10-12, S10, `09` §3 decision 205): a box whose root statfs failed sends // its "/" entry with zeros AND `read_failed: true` (controller v0.308.0). The dashboard's Disk column // is the hub's one reader of that list; it must say the reading failed, never show the zeros as 0 %. // An older box sends no field — its entries read as before. // RED-PROOF: without the read_failed branch in parseDiskSummary this returns "0%/41%". func TestDiskSummaryShowsAFailedRead(t *testing.T) { cases := map[string]string{ `{"storage":[{"mount":"/","percent":0,"read_failed":true},{"mount":"/mnt/hdd","percent":41.2}]}`: "read failed/41%", `{"storage":[{"mount":"/","percent":12.4},{"mount":"/mnt/hdd","percent":41.2}]}`: "12%/41%", `{"storage":[]}`: "–", } for in, want := range cases { if got := parseDiskSummary(in); got != want { t.Errorf("parseDiskSummary(%s) = %q, want %q", in, got, want) } } }