test: pin netProbeFSClass=network in the C5 child-body suite (real statfs on linux correctly refuses tempdir)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user