Development
Testing without hardware
200 fake boxes that exercise the real download, hash and extraction paths.
The agent's -fake-root mode stubs out pm, dumpsys and getprop and
nothing else — the download, the sha256 check and the .apkm extraction are
all real. So a fake fleet exercises the actual pipeline, not a mock of it.
make agent
./scripts/fake-fleet.sh 200 <enrollment-token>On Windows:
./scripts/build-agent.ps1
./scripts/fake-fleet.ps1 -Count 200 -Token <token>Each fake box enrolls with its own serial, opens its own socket and shows up in the fleet table like any other device.
Failure injection
Lives in agent/internal/sys/fake.go, driven by environment variables:
| Variable | Effect |
|---|---|
MAGNEMITE_FAKE_COMMIT_ERROR | Text that install-commit fails with |
MAGNEMITE_FAKE_COMMIT_ERROR_ONCE | Fail only the first commit, to exercise the uninstall fallback |
MAGNEMITE_FAKE_FREE_BYTES | Override free space, to trip the space gate |
MAGNEMITE_FAKE_INSTALL_MS | How long a commit pretends to take |
What this is good for
- Scheduler behaviour under load. 200 devices against
MAX_CONCURRENT_JOBS=10is the only honest way to see the queue drain. - The canary path. Fail one commit and watch the rollout park at
PAUSED. - The clean-install fallback.
..._ONCEmakes the agent take the uninstall-and-reinstall branch on demand. - Stall handling. A long
MAGNEMITE_FAKE_INSTALL_MSplus a lowJOB_STALL_TIMEOUTreproduces a re-queue in under a minute.
A fake fleet downloads real bundles. 200 fakes pulling a 172 MB .apkm is ~35 GB through your own
machine — cap the count, or point them at a small artifact.