Files
felhom.eu/hub/internal/store/disk_summary_read_failed_test.go
T
admin 655f5f66f8
gates / gates (push) Successful in 6m0s
hub v0.147.0 (code): the operator's answers S4, S6, S10, S29, S30, S32, S33
- S4 / R-242: GoldenVouchChecker - a published golden unvouched for 2 h raises golden_not_vouched (operator only)
- S6 / R-244: the delete cascade de-references app_log_issues; one-time sweep flag -sweep-app-log-residue=count|apply
- S10 / R-266: read_failed storage entry shows "read failed", not 0 %
- S29 / R-250: host-key scan IPv4 first, ~2 min ladder, "safe to press Save again" error
- S30 / R-246: stale_at retired (reader, setter, badge)
- S32 / R-521: storage_reconnected ends the storage_disconnected cooldown on both channels
- S33 / R-402: host page "Last full check (off-site)" line; two wire-gate allowlist entries removed
Each with a test seen failing first. Not built or deployed yet (operator-attended deploy).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-10-12 14:54:14 +02:00

22 lines
988 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}
}
}