Magnemite
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:

VariableEffect
MAGNEMITE_FAKE_COMMIT_ERRORText that install-commit fails with
MAGNEMITE_FAKE_COMMIT_ERROR_ONCEFail only the first commit, to exercise the uninstall fallback
MAGNEMITE_FAKE_FREE_BYTESOverride free space, to trip the space gate
MAGNEMITE_FAKE_INSTALL_MSHow long a commit pretends to take

What this is good for

  • Scheduler behaviour under load. 200 devices against MAX_CONCURRENT_JOBS=10 is 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. ..._ONCE makes the agent take the uninstall-and-reinstall branch on demand.
  • Stall handling. A long MAGNEMITE_FAKE_INSTALL_MS plus a low JOB_STALL_TIMEOUT reproduces 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.

On this page