Skip to main content

Crate planarian_fake

Crate planarian_fake 

Source
Expand description

A fake machine: every backend trait, in memory, deterministic.

It models what the catalog’s fake-harness cases need. The NixOS side has generations, an owner source tree, the override file, a tiny evaluator (option rules that break, remove or alter units), builds, live activation, boot entries and GC. The systemd side has units that crash, flap, fail on start, or are restarted by systemd itself. Devices have drivers. logind has sessions. There are external dependencies, runtime options, and processes (owner and worker pids). Fencing reads the epochs in the shared journal store, as real backends read the journal’s.

Time advances only through Clock::sleep or Fake::advance.

Modules§

fixtures
The gym’s reference units (catalog [[fixture]]), as a manifest would declare them. Canonical probes are attached by state from canonical().

Structs§

Call
Fake
The handle every backend trait is implemented on. Cheap to clone; all clones share one world and one journal store.
Gen
Job
MemStore
Rule
If option option evaluates to value, apply effect.
UnitSim
World

Enums§

Effect
Health
Injected
An outcome injected into the next call of one name (the gym’s backend_result and the assumptions conformance run): the effect lands but the call reports failure (Partial) or cannot say (Unknown), or the call is refused before any effect as if fenced.

Constants§

GEN_BYTES
The closure size of one fake generation.
NO_OP 🔒
The op a call outside any transaction is recorded under (the hold).
PAYLOAD_DELAY
How long the gym’s bad payload behaves before it takes gym-web’s port: past any generation check (§15 malicious declaration).

Functions§

gym_world
A fake machine built from the gym fixtures (catalog [[fixture]]), on its first generation, healthy, with nobody logged in.