common

package
v0.51.2-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package common contains basic test operation for agent-platform tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAgentBehaviour

func CheckAgentBehaviour(t *testing.T, client *TestClient)

CheckAgentBehaviour runs test to check the agent is behaving as expected

func CheckAgentPython

func CheckAgentPython(t *testing.T, client *TestClient, version string)

CheckAgentPython runs tests to check the agent use the correct python version

func CheckAgentRestarts

func CheckAgentRestarts(t *testing.T, client *TestClient)

CheckAgentRestarts runs tests to check the agent can restart properly

func CheckAgentStops

func CheckAgentStops(t *testing.T, client *TestClient)

CheckAgentStops runs tests to check the agent can stop properly

func CheckApmDisabled

func CheckApmDisabled(t *testing.T, client *TestClient)

CheckApmDisabled runs tests to check the agent behave properly when APM is disabled

func CheckApmEnabled

func CheckApmEnabled(t *testing.T, client *TestClient)

CheckApmEnabled runs tests to check the agent behave properly with APM enabled

func CheckCWSBehaviour

func CheckCWSBehaviour(t *testing.T, client *TestClient)

CheckCWSBehaviour runs tests to check the agent behave correctly when CWS is enabled

func CheckDogstatdAgentBehaviour added in v0.51.0

func CheckDogstatdAgentBehaviour(t *testing.T, client *TestClient)

CheckDogstatdAgentBehaviour runs tests to check the agent behave properly with dogstatsd

func CheckDogstatsdAgentRestarts added in v0.51.0

func CheckDogstatsdAgentRestarts(t *testing.T, client *TestClient)

CheckDogstatsdAgentRestarts runs tests to check the agent can restart properly

func CheckDogstatsdAgentStops added in v0.51.0

func CheckDogstatsdAgentStops(t *testing.T, client *TestClient)

CheckDogstatsdAgentStops runs tests to check the agent can stop properly

func CheckInstallation

func CheckInstallation(t *testing.T, client *TestClient)

CheckInstallation run tests to check the installation of the agent

func CheckInstallationInstallScript

func CheckInstallationInstallScript(t *testing.T, client *TestClient)

CheckInstallationInstallScript run tests to check the installation of the agent with the install script

func CheckInstallationMajorAgentVersion added in v0.51.0

func CheckInstallationMajorAgentVersion(t *testing.T, client *TestClient, expectedVersion string) bool

CheckInstallationMajorAgentVersion run tests to check the installation of an agent has the correct major version

func CheckIntegrationInstall

func CheckIntegrationInstall(t *testing.T, client *TestClient)

CheckIntegrationInstall run test to test installation of integrations

func CheckUninstallation

func CheckUninstallation(t *testing.T, client *TestClient, packageName string)

CheckUninstallation runs check to see if the agent uninstall properly

Types

type FileManager

type FileManager interface {
	ReadFile(path string) (string, error)
	FileExists(path string) (string, error)
	FindFileInFolder(path string) (string, error)
	WriteFile(path string, content string) (string, error)
}

FileManager generic interface

type Helper

type Helper interface {
	GetInstallFolder() string
	GetConfigFolder() string
	GetBinaryPath() string
	GetConfigFileName() string
	GetServiceName() string
}

Helper generic interface

type PackageManager

type PackageManager interface {
	Remove(pkg string) (string, error)
}

PackageManager generic interface

type ServiceManager

type ServiceManager interface {
	Status(service string) (string, error)
	Start(service string) (string, error)
	Stop(service string) (string, error)
	Restart(service string) (string, error)
}

ServiceManager generic interface

type TestClient

type TestClient struct {
	Host        *components.RemoteHost
	AgentClient agentclient.Agent
	Helper      Helper
	FileManager FileManager
	SvcManager  ServiceManager
	PkgManager  PackageManager
}

TestClient contain the Agent Env and SvcManager and PkgManager for tests

func NewTestClient

func NewTestClient(host *components.RemoteHost, agentClient agentclient.Agent, fileManager FileManager, helper Helper) *TestClient

NewTestClient create a an ExtendedClient from VMClient and AgentCommandRunner, includes svcManager and pkgManager to write agent-platform tests

func (*TestClient) CheckPortBound

func (c *TestClient) CheckPortBound(port int) error

CheckPortBound check if the port is currently bound, use netstat or ss

func (*TestClient) ExecuteWithRetry

func (c *TestClient) ExecuteWithRetry(cmd string) (string, error)

ExecuteWithRetry execute the command with retry

func (*TestClient) GetPythonVersion

func (c *TestClient) GetPythonVersion() (string, error)

GetPythonVersion returns python version from the Agent status

func (*TestClient) SetConfig

func (c *TestClient) SetConfig(confPath string, key string, value string) error

SetConfig set config given a key and a path to a yaml config file, support key nested twice at most

Directories

Path Synopsis
Package filemanager implement interfaces to run install-script tests
Package filemanager implement interfaces to run install-script tests
Package helper implement interfaces to get some information that can be OS specific
Package helper implement interfaces to get some information that can be OS specific
Package pkgmanager contains pkgmanager implementations
Package pkgmanager contains pkgmanager implementations
Package svcmanager contains svcmanager implementations
Package svcmanager contains svcmanager implementations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL