Documentation
¶
Overview ¶
Package backendtest checks the shared converge contract of backend.Backend implementations using backend-specific fakes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
Factory builds a fresh Fixture over fresh fakes. Suite calls it once per subtest so no clause observes another's mutations.
type Fixture ¶
type Fixture struct {
// Backend is a fresh backend over fakes, with nothing installed.
Backend backend.Backend
// ValidConfig is a config the backend accepts.
ValidConfig backend.Config
// SecondConfig is another accepted config that differs from ValidConfig,
// so a Set that replaces one with the other must write.
SecondConfig backend.Config
// Clean reports whether managed system DNS artifacts are absent.
Clean func() (bool, error)
// Snapshot returns a comparable representation of the fake system's DNS
// state. Nil marks a backend that installs nothing.
Snapshot func() (any, error)
// Writes counts every host mutation the fakes observed, including cache
// flushes and policy notifications. Nil marks a backend that installs
// nothing, which skips the no-op check.
Writes func() int
// FailSideEffects, while armed, makes each owed side effect (a cache
// flush or policy notification) fail. Nil skips the side-effect clauses.
FailSideEffects func(fail bool)
// FailInspection, while armed, makes each attempt fail while it inspects
// the host, before it changes anything or reaches its side effects. Nil
// skips the clauses that need it.
FailInspection func(fail bool)
}
Fixture is what a backend test hands Suite: a live backend over fakes, a config it accepts, and observers of the fake system.