Skip to content

Concept

Protocol model

The operator changes a machine through some controllers that work together. Each controller reads a cache that can be late, and a process can stop at each point. Two model tests check the protocol across many orders of events.

The protocol model holds the full system as one world. Actors take turns: claim controller, executor, person, machine, convergence. After each turn the invariants are checked. A failure prints the shortest sequence of turns.claim controllerexecutorpersonmachine, convergenceWorldnow and one turn beforeInvariants11 checksCounterexampleshortest patheach turn
An explicit-state model check, breadth first, about 1.2 million states at 14 turns.
Test What it checks Size
TestProtocolModel Each order of turns of the controllers, a person and the machine, with stale reads 14 turns, about 40 seconds
TestExecutorModel The real executor against the Redfish simulator, with faults and process stops 300 cases from a fixed seed
World
The full system state as one value: one Host, one claim, the machine, three operation slots.
Stale read
A controller reads an object kind from the world one turn before. The model tries each choice.
Invariant
A rule that must be true after each turn. For example: at most one started operation runs on a Host.
  1. At most one started, unfinished operation runs on a Host.
  2. Only an approved operation mounts media.
  3. A machine that a boot touched is unbound only after a release turned it off.
  4. A release of a machine that ran its node waits for a person.
  5. A power action on a control plane of the operator cluster starts only with metal.platform-kit.org/allow-self-disruption.

The model calls the same helper functions as the controllers. Only the control flow is written again in the test.

A hold set right after the deletion of a claim does not stop a release that needs no approval. To keep a machine, hold the claim before you delete it.

Terminal window
cd metal
PK_MODEL_DEPTH=16 go test -count=1 -run TestProtocolModel -v ./internal/controller