// Package fakes is the umbrella for deterministic stand-ins for // external probe binaries that Vetting's stage code normally shells // out to (stress-ng, fio, iperf3, dmidecode, ethtool, nvidia-smi, // mcelog, nvme). Each real binary gets its own subpackage under // fakes// with `package main` and a main() that prints golden // output — build with `go build -o / ./agent/tests/fakes/` // and point a test's tests.Deps.LookPath at /. // // The seam in tests is tests.Deps.LookPath: when non-nil the stage // code uses it instead of os/exec.LookPath. Outside tests, nil // LookPath means "use the real binary on $PATH" — stages continue to // work on production hosts without the fakes package around. // // How to add a new fake: // 1. Create agent/tests/fakes//main.go. // 2. Write `package main` with a main() that prints exactly the // bytes the real tool would produce for the input you care to // simulate. Determinism > completeness — tests want a known // sample, not a realistic one. // 3. Reference the fake from the unit test with `go test` compiling // it via t.TempDir() + `go build -o` before the test body runs. package fakes