Documentation
¶
Index ¶
- func BuildOperatorStatusCommand(scopes []OperatorScope) string
- func CheckOperators(fw *framework.TestFramework) error
- func ForwardingExpectedBytes() []byte
- func MatchesForwardingProbe(packet []byte) bool
- func OperatorFingerprintFiles() []string
- func PrepareOperators(fw *framework.TestFramework) error
- func RequiredArtifacts(root string) []string
- func ScopeNames() []string
- func ShellJoin(argv []string) string
- func StartOperators(fw *framework.TestFramework) error
- func TruncateOutput(output string) string
- func WaitOperators(fw *framework.TestFramework) error
- func WithoutEthernetPadding(packet []byte) []byte
- type Boot
- type File
- type Manifest
- type ManifestRuntime
- type OperatorScope
- type Probe
- type ProbeExpect
- type ProbeSend
- type Result
- type RunReport
- type ScopeResult
- type ScopeState
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOperatorStatusCommand ¶
func BuildOperatorStatusCommand(scopes []OperatorScope) string
BuildOperatorStatusCommand renders the per-scope status command for the given scopes: every probe runs without short-circuiting and prints one marked line per scope, so a single guest command bounds the complete reporting pass. Exported so the generated wire format can be exercised on any scope table, not only the pinned AD-11 one.
func CheckOperators ¶
func CheckOperators(fw *framework.TestFramework) error
CheckOperators verifies the complete operator-owned lab profile.
func ForwardingExpectedBytes ¶
func ForwardingExpectedBytes() []byte
ForwardingExpectedBytes returns a copy of the canonical operator forwarding probe packet bytes. The returned slice is a copy; callers may freely mutate it. The underlying fixture is private to prevent accidental shared state.
func MatchesForwardingProbe ¶
func OperatorFingerprintFiles ¶
func OperatorFingerprintFiles() []string
OperatorFingerprintFiles lists source files that invalidate the lab operator snapshot.
func PrepareOperators ¶
func PrepareOperators(fw *framework.TestFramework) error
PrepareOperators stages the lab-only operator and BIRD artifacts in guest tmpfs.
func RequiredArtifacts ¶
RequiredArtifacts lists host files needed to prepare the operator baseline.
func ScopeNames ¶
func ScopeNames() []string
ScopeNames returns the pinned Operator Profile scope names in execution order (AD-11).
func ShellJoin ¶
ShellJoin quotes each argument with single-quote escaping and joins them with spaces, suitable for passing a command and arguments to a POSIX shell.
func StartOperators ¶
func StartOperators(fw *framework.TestFramework) error
StartOperators launches the complete operator-owned lab configuration.
func TruncateOutput ¶
TruncateOutput caps output to maxResultOutput bytes, appending a truncation notice if the original exceeded the limit.
func WaitOperators ¶
func WaitOperators(fw *framework.TestFramework) error
WaitOperators waits for the complete operator-owned lab profile.
func WithoutEthernetPadding ¶
WithoutEthernetPadding strips Ethernet padding from a packet, returning only the bytes up to and including the IP payload as indicated by the IP header length field. Returns the original packet if the header is too short.
Types ¶
type Manifest ¶
type Manifest struct {
Schema string `yaml:"$schema,omitempty" json:"$schema,omitempty"`
Version int `yaml:"version" json:"version"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Boot Boot `yaml:"boot,omitempty" json:"boot"`
Files []File `yaml:"files,omitempty" json:"files,omitempty"`
Steps []Step `yaml:"steps,omitempty" json:"steps,omitempty"`
Probes []Probe `yaml:"probes,omitempty" json:"probes,omitempty"`
}
func LoadManifest ¶
type ManifestRuntime ¶
type ManifestRuntime interface {
CommonConfigCommands() []string
ExecuteCommand(string) (string, error)
ExecuteCommandWithTimeout(string, time.Duration) (string, error)
ExecuteCommands(...string) ([]string, error)
ResetConnections()
RestoreClean(string) error
SendPacketAndCaptureAllUnfiltered(int, int, []byte, time.Duration) ([][]byte, error)
StartYANET(string, string) error
WaitForDatapathReady(time.Duration) error
}
ManifestRuntime provides the VM operations needed to execute a manifest.
type OperatorScope ¶
OperatorScope is one named probe of the pinned Operator Profile (AD-11). The Command exits zero while the scope is ready in the guest and Reason names the failure the probe detects.
type Probe ¶
type Probe struct {
Name string `yaml:"name" json:"name"`
Ingress int `yaml:"ingress" json:"ingress"`
Egress int `yaml:"egress" json:"egress"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Send ProbeSend `yaml:"send" json:"send"`
Expect ProbeExpect `yaml:"expect" json:"expect"`
}
type ProbeExpect ¶
type RunReport ¶
type RunReport struct {
Manifest string `json:"manifest"`
Started time.Time `json:"started"`
Finished time.Time `json:"finished"`
Success bool `json:"success"`
Results []Result `json:"results"`
}
func RunManifest ¶
func RunManifest(runtime ManifestRuntime, path string) RunReport
RunManifest executes a validated lab manifest against runtime.
type ScopeResult ¶
type ScopeResult struct {
// Name identifies the scope.
Name string `json:"name"`
// State is ready when the scope's probe succeeded.
State ScopeState `json:"state"`
// Reason names the failure, empty while the scope is ready.
Reason string `json:"reason,omitempty"`
}
ScopeResult is the outcome of one Operator Profile scope probe.
func CheckStatus ¶
func CheckStatus(fw *framework.TestFramework) ([]ScopeResult, error)
CheckStatus runs every Operator Profile scope probe as one guest command and returns the parsed per-scope outcomes. It changes no Lab state and does not run the forwarding packet probe, which stays in startup health only.
func ParseScopeStatus ¶
func ParseScopeStatus(output string) []ScopeResult
ParseScopeStatus parses the marked per-scope lines of the Operator Profile status command into one result per scope. It fails closed: a scope whose line is absent, truncated, duplicated, or otherwise malformed is reported NOT_READY with an explicit parse reason and is never assumed healthy.
func ParseScopeStatusFor ¶
func ParseScopeStatusFor(output string, scopes []OperatorScope) []ScopeResult
ParseScopeStatusFor parses marked per-scope output against an explicit scope table, failing closed exactly like ParseScopeStatus. Exported so the parser can be pinned to the output of BuildOperatorStatusCommand on any scope set.
type ScopeState ¶
type ScopeState string
ScopeState is the readiness state of one Operator Profile scope.
const ( StateReady ScopeState = "ready" StateNotReady ScopeState = "not_ready" )
Operator Profile scope states reported by the status parser.