Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
Package enginetest contains shared, provider-neutral reconciliation assertions.
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
Index ¶
- Constants
- Variables
- func AssertIdle(t *testing.T, p engine.Provider, rc *engine.Context, apply func())
- func SupabaseCredentialContracts(t *testing.T, keys sbkeys.Keys)
- type CredentialLimit
- type CredentialStore
- func (s *CredentialStore) Assert(t *testing.T, limits map[string]CredentialLimit, usernameMax int)
- func (s *CredentialStore) AssertValues(t *testing.T, limits map[string]CredentialLimit, usernameMax int)
- func (s *CredentialStore) SetAgentToken(ctx context.Context, token *domain.AgentToken) error
- func (s *CredentialStore) SetClusterSecret(ctx context.Context, ref domain.ClusterRef, key string, value []byte) error
- type RecordingBackend
- func (b *RecordingBackend) Calls() []string
- func (*RecordingBackend) Capabilities() infra.Capabilities
- func (b *RecordingBackend) DeletePublicPorts(ctx context.Context, name string) error
- func (b *RecordingBackend) DeleteService(ctx context.Context, name string) (infra.Op, error)
- func (b *RecordingBackend) DeleteServiceByID(ctx context.Context, name, id string) (infra.Op, error)
- func (b *RecordingBackend) Deploy(ctx context.Context, name string, d infra.Deployment) (infra.Op, error)
- func (b *RecordingBackend) EnsurePublicPort(ctx context.Context, name string, port infra.PublicPort) error
- func (b *RecordingBackend) ImportServices(ctx context.Context, specs []infra.ServiceSpec) (infra.Op, error)
- func (*RecordingBackend) Layout() infra.Layout
- func (*RecordingBackend) Name() string
- func (b *RecordingBackend) Restart(ctx context.Context, name string) (infra.Op, error)
- func (b *RecordingBackend) SetContainerCount(ctx context.Context, name string, min, max int) (infra.Op, error)
- func (b *RecordingBackend) SetEnvSecrets(ctx context.Context, name string, env map[string]string) error
- func (b *RecordingBackend) SetEnvVars(ctx context.Context, name string, env map[string]string) error
- func (b *RecordingBackend) SetResources(ctx context.Context, name string, r infra.Resources) (infra.Op, error)
- func (b *RecordingBackend) SetSubdomainAccess(ctx context.Context, name string, enabled bool) (infra.Op, error)
- func (b *RecordingBackend) Start(ctx context.Context, name string) (infra.Op, error)
- func (b *RecordingBackend) Stop(ctx context.Context, name string) (infra.Op, error)
- func (b *RecordingBackend) SubdomainURLs(ctx context.Context, name string) ([]string, error)
Constants ¶
const Alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
const IdleCycles = 20
IdleCycles deliberately reloads pointers on every reconciliation, rather than comparing an in-memory checkpoint with the object that originally created it.
Variables ¶
var AgentCredential = CredentialLimit{51, 51, Alphanumeric + "_", "kk_"}
AgentCredential is Karakoram's bearer format, not a native engine password.
Functions ¶
func AssertIdle ¶
AssertIdle drives ordinary Sync plus the shared availability observation to Ready, persists through the real SQL store and JSON decoder after EVERY cycle, then requires twenty further Ready cycles without an infrastructure mutation. Applied generation is checked separately: a healthy but unconverged fixture cannot accidentally pass. Positive provider samples must satisfy the same freshness contract as production, not just return Ready from raw Status. apply models agent configuration acceptance, not provider reconciliation.
func SupabaseCredentialContracts ¶ added in v0.4.2
SupabaseCredentialContracts checks every persisted field, not a password proxy. Formats: https://supabase.com/docs/guides/self-hosting/self-hosted-auth-keys Component key sizes: https://supabase.com/docs/guides/self-hosting/docker P-256 JWK coordinates/scalars: RFC 7518 section 6.2 (32 octets, base64url).
Types ¶
type CredentialLimit ¶ added in v0.4.2
CredentialLimit describes an output contract. Max == 0 means no documented native maximum, not a claim that every possible input is accepted.
type CredentialStore ¶ added in v0.4.2
type CredentialStore struct {
engine.SecretStore
Values map[string][]byte
Tokens map[string]string
}
CredentialStore observes real provider writes while retaining the fixture's persistence behavior. TLS material is transport identity, not a password. Native OpenBao /sys/init root tokens/shares and Elasticsearch service-account tokens/API keys are engine-generated opaque outputs: no bounds are invented.
func RecordCredentials ¶ added in v0.4.2
func RecordCredentials(rc *engine.Context) *CredentialStore
func (*CredentialStore) Assert ¶ added in v0.4.2
func (s *CredentialStore) Assert(t *testing.T, limits map[string]CredentialLimit, usernameMax int)
Assert also requires and checks credentials persisted in the agent-token store.
func (*CredentialStore) AssertValues ¶ added in v0.4.2
func (s *CredentialStore) AssertValues(t *testing.T, limits map[string]CredentialLimit, usernameMax int)
AssertValues rejects every unlisted persisted credential, including future keys. Every declared key must be written, preventing vacuous seeding tests.
func (*CredentialStore) SetAgentToken ¶ added in v0.4.2
func (s *CredentialStore) SetAgentToken(ctx context.Context, token *domain.AgentToken) error
func (*CredentialStore) SetClusterSecret ¶ added in v0.4.2
func (s *CredentialStore) SetClusterSecret(ctx context.Context, ref domain.ClusterRef, key string, value []byte) error
type RecordingBackend ¶
RecordingBackend preserves a fixture's observations and mutation semantics, while exposing the real Zerops layout/capabilities and recording ALL mutation submissions, including redundant requests and requests that fail.
func (*RecordingBackend) Calls ¶
func (b *RecordingBackend) Calls() []string
func (*RecordingBackend) Capabilities ¶
func (*RecordingBackend) Capabilities() infra.Capabilities
func (*RecordingBackend) DeletePublicPorts ¶
func (b *RecordingBackend) DeletePublicPorts(ctx context.Context, name string) error
func (*RecordingBackend) DeleteService ¶
func (*RecordingBackend) DeleteServiceByID ¶
func (*RecordingBackend) Deploy ¶
func (b *RecordingBackend) Deploy(ctx context.Context, name string, d infra.Deployment) (infra.Op, error)
func (*RecordingBackend) EnsurePublicPort ¶
func (b *RecordingBackend) EnsurePublicPort(ctx context.Context, name string, port infra.PublicPort) error
func (*RecordingBackend) ImportServices ¶
func (b *RecordingBackend) ImportServices(ctx context.Context, specs []infra.ServiceSpec) (infra.Op, error)
func (*RecordingBackend) Layout ¶
func (*RecordingBackend) Layout() infra.Layout
func (*RecordingBackend) Name ¶
func (*RecordingBackend) Name() string