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 two tests
Section titled “The two tests”| 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.
Selected invariants
Section titled “Selected invariants”- At most one started, unfinished operation runs on a Host.
- Only an approved operation mounts media.
- A machine that a boot touched is unbound only after a release turned it off.
- A release of a machine that ran its node waits for a person.
- 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.
Known limit
Section titled “Known limit”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.
Run it
Section titled “Run it”cd metalPK_MODEL_DEPTH=16 go test -count=1 -run TestProtocolModel -v ./internal/controller