From 4a9c54a105d0e997c5efde881ee26513c2a8b56e Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sat, 11 Jul 2026 21:15:48 +0200 Subject: [PATCH] test: pin netProbeFSClass=network in the C5 child-body suite (real statfs on linux correctly refuses tempdir) Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6 --- controller/internal/web/netstorage_job_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controller/internal/web/netstorage_job_test.go b/controller/internal/web/netstorage_job_test.go index 3bf6da3..b009ff0 100644 --- a/controller/internal/web/netstorage_job_test.go +++ b/controller/internal/web/netstorage_job_test.go @@ -14,6 +14,7 @@ import ( "gitea.dooplex.hu/admin/felhom-controller/internal/agentapi" "gitea.dooplex.hu/admin/felhom-controller/internal/settings" + "gitea.dooplex.hu/admin/felhom-controller/internal/system" ) // Orchestration tests (verify-before-commit): everything runs through the netAgent / netProbeFn / @@ -220,7 +221,13 @@ func TestNetAdd_VerifyLost_RollsBack(t *testing.T) { } // --- C5: the --netprobe child body (pure file logic, t.TempDir) --------------------------------------- +// The fstype assertion (RCA fix 2) is pinned to `network` here — these rows test the WRITE/READBACK/ +// CLEANUP logic against a local tempdir, which the real classifier would (correctly) refuse as a +// stub. The assertion has its own suite: netprobe_stub_test.go. func TestNetProbeChild(t *testing.T) { + origClass := netProbeFSClass + netProbeFSClass = func(string) string { return system.FSClassNetwork } + t.Cleanup(func() { netProbeFSClass = origClass }) t.Run("ok", func(t *testing.T) { dir := t.TempDir() if got := NetProbeChild(dir); got != netProbeExitOK {