Documentation ¶
Overview ¶
Package client contains clients used to communicate with the remote service
Index ¶
- func CallStackInitializers[Env any](t *testing.T, env *Env, upResult auto.UpResult) error
- func CheckEnvStructValid[Env any]() error
- type Agent
- type AgentArgsOption
- type AgentCommandRunner
- func (agent *AgentCommandRunner) Config(commandArgs ...AgentArgsOption) string
- func (agent *AgentCommandRunner) ConfigCheck(commandArgs ...AgentArgsOption) string
- func (agent *AgentCommandRunner) Flare(commandArgs ...AgentArgsOption) string
- func (agent *AgentCommandRunner) Health() (string, error)
- func (agent *AgentCommandRunner) Hostname(commandArgs ...AgentArgsOption) string
- func (agent *AgentCommandRunner) Secret(commandArgs ...AgentArgsOption) string
- func (agent *AgentCommandRunner) Status(commandArgs ...AgentArgsOption) *Status
- func (agent *AgentCommandRunner) Version(commandArgs ...AgentArgsOption) string
- type Docker
- func (docker *Docker) ExecuteCommand(containerName string, commands ...string) string
- func (docker *Docker) ExecuteCommandStdoutStdErr(containerName string, commands ...string) (string, string, error)
- func (docker *Docker) ExecuteCommandWithErr(containerName string, commands ...string) (string, error)
- func (docker *Docker) GetAgentCommandRunner() *AgentCommandRunner
- func (docker *Docker) GetAgentContainerName() string
- func (docker *Docker) GetClient() *client.Client
- type EC2Metadata
- type Fakeintake
- type Status
- type UpResultDeserializer
- type VM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallStackInitializers ¶
CallStackInitializers validate an environment struct and initialise a stack
func CheckEnvStructValid ¶
CheckEnvStructValid validates an environment struct
Types ¶
type Agent ¶
type Agent struct { *UpResultDeserializer[agent.ClientData] *AgentCommandRunner // contains filtered or unexported fields }
An Agent that is connected to an agent.Installer.
func NewAgent ¶
func NewAgent(installer *agent.Installer, agentClientOptions ...agentclientparams.Option) *Agent
NewAgent creates a new instance of an Agent connected to an agent.Installer.
func (*Agent) IsReady ¶
IsReady runs status command and returns true if the command returns a zero exit code. This function should rarely be used.
func (*Agent) WaitAgentLogs ¶
WaitAgentLogs waits for the agent log corresponding to the pattern agent-name can be: datadog-agent, system-probe, security-agent pattern: is the log that we are looking for Retries every 500 ms up to timeout. Returns error on failure.
type AgentArgsOption ¶
type AgentArgsOption = func(*agentArgs)
AgentArgsOption is an optional function parameter type for Agent arguments
type AgentCommandRunner ¶
type AgentCommandRunner struct {
// contains filtered or unexported fields
}
AgentCommandRunner provides high level methods to run commands on the Agent.
func (*AgentCommandRunner) Config ¶
func (agent *AgentCommandRunner) Config(commandArgs ...AgentArgsOption) string
Config runs config command and returns the runtime agent config
func (*AgentCommandRunner) ConfigCheck ¶
func (agent *AgentCommandRunner) ConfigCheck(commandArgs ...AgentArgsOption) string
ConfigCheck runs configcheck command and returns the runtime agent configcheck
func (*AgentCommandRunner) Flare ¶
func (agent *AgentCommandRunner) Flare(commandArgs ...AgentArgsOption) string
Flare runs flare command and returns the output. You should use the FakeIntake client to fetch the flare archive
func (*AgentCommandRunner) Health ¶
func (agent *AgentCommandRunner) Health() (string, error)
Health runs health command and returns the runtime agent health
func (*AgentCommandRunner) Hostname ¶
func (agent *AgentCommandRunner) Hostname(commandArgs ...AgentArgsOption) string
Hostname runs hostname command and returns the runtime Agent hostname
func (*AgentCommandRunner) Secret ¶
func (agent *AgentCommandRunner) Secret(commandArgs ...AgentArgsOption) string
Secret runs the secret command
func (*AgentCommandRunner) Status ¶
func (agent *AgentCommandRunner) Status(commandArgs ...AgentArgsOption) *Status
Status runs status command and returns a Status struct
func (*AgentCommandRunner) Version ¶
func (agent *AgentCommandRunner) Version(commandArgs ...AgentArgsOption) string
Version runs version command returns the runtime Agent version
type Docker ¶
type Docker struct { *UpResultDeserializer[docker.ClientData] // contains filtered or unexported fields }
A Docker client that is connected to an docker.Deamon.
func (*Docker) ExecuteCommand ¶
ExecuteCommand executes a command on containerName and returns the output.
func (*Docker) ExecuteCommandStdoutStdErr ¶
func (docker *Docker) ExecuteCommandStdoutStdErr(containerName string, commands ...string) (string, string, error)
ExecuteCommandStdoutStdErr executes a command on containerName and returns the output, the error output and an error.
func (*Docker) ExecuteCommandWithErr ¶
func (docker *Docker) ExecuteCommandWithErr(containerName string, commands ...string) (string, error)
ExecuteCommandWithErr executes a command on containerName and returns the output and an error.
func (*Docker) GetAgentCommandRunner ¶
func (docker *Docker) GetAgentCommandRunner() *AgentCommandRunner
GetAgentCommandRunner gets a runner that provides high level methods to run Agent commands.
func (*Docker) GetAgentContainerName ¶
GetAgentContainerName gets the agent container name
type EC2Metadata ¶
type EC2Metadata struct {
// contains filtered or unexported fields
}
EC2Metadata contains a pointer to a VM and its AWS token
func NewEC2Metadata ¶
func NewEC2Metadata(vm *VM) *EC2Metadata
NewEC2Metadata creates a new EC2Metadata given an EC2 VM
func (*EC2Metadata) Get ¶
func (m *EC2Metadata) Get(name string) string
Get returns EC2 instance name
type Fakeintake ¶
type Fakeintake struct { *UpResultDeserializer[infraFakeintake.ClientData] *fakeintake.Client }
A Fakeintake client that is connected to a fakeintake ECS task defined in test-infra-definition.
func NewFakeintake ¶
func NewFakeintake(exporter *infraFakeintake.ConnectionExporter) *Fakeintake
NewFakeintake creates a new instance of
type UpResultDeserializer ¶
type UpResultDeserializer[T any] struct { // contains filtered or unexported fields }
UpResultDeserializer is an helper to build a new type that can be used in an environment. It is designed to be used as an embedded field. See VM type in this package for an example of usage.
func NewUpResultDeserializer ¶
func NewUpResultDeserializer[T any]( deserializer utils.RemoteServiceDeserializer[T], initializer clientServiceInitializer[T]) *UpResultDeserializer[T]
NewUpResultDeserializer creates a new instance of UpResultDeserializer. deserializer is a function that deserializes the output of a stack init is a function that initializes the parent struct.
type VM ¶
type VM struct { *UpResultDeserializer[commonvm.ClientData] // contains filtered or unexported fields }
VM is a client VM that is connected to a VM defined in test-infra-definition.
func (VM) CopyFolder ¶
CopyFolder copy a folder to the remote host
func (VM) ExecuteWithError ¶
ExecuteWithError executes a command and returns an error if any.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package agentclientparams implements function parameters for [e2e.Agent]
|
Package agentclientparams implements function parameters for [e2e.Agent] |