suites

package
v0.0.0-...-4a9fccf Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UDP_CLIENT = "udp-client"
	UDP_SERVER = "udp-server"

	// The number of containers to be created in
	// multi destination/source tests
	CONTAINER_COUNT = 3
)

Variables

This section is empty.

Functions

func Mem2Numeric

func Mem2Numeric(value string) (float64, error)

Convert memory string from docker stats into numeric value in MiB

Types

type AsyncConnectionTestSuite

type AsyncConnectionTestSuite struct {
	IntegrationTestSuiteBase
	DisableConnectionStatusTracking bool
	BlockConnection                 bool
	ExpectToSeeTheConnection        bool
	// contains filtered or unexported fields
}

func (*AsyncConnectionTestSuite) SetupSuite

func (s *AsyncConnectionTestSuite) SetupSuite()

* This suite has 2 main cases: * - BlockConnection=false: verify that a successful asynchronous connection gets reported * We provide curl-test with the IP of a TCP server to isntruct it to connect to this server. * - BlockConnection=true : verify that a failed aynchronous connection is not * No parameter to curl-test, and in this case, it simulates a firewall rule by connecting to * a dummy address.

func (*AsyncConnectionTestSuite) TearDownSuite

func (s *AsyncConnectionTestSuite) TearDownSuite()

func (*AsyncConnectionTestSuite) TestNetworkFlows

func (s *AsyncConnectionTestSuite) TestNetworkFlows()

type BenchmarkBaselineTestSuite

type BenchmarkBaselineTestSuite struct {
	BenchmarkTestSuiteBase
}

func (*BenchmarkBaselineTestSuite) SetupSuite

func (s *BenchmarkBaselineTestSuite) SetupSuite()

func (*BenchmarkBaselineTestSuite) TearDownSuite

func (s *BenchmarkBaselineTestSuite) TearDownSuite()

func (*BenchmarkBaselineTestSuite) TestBenchmarkBaseline

func (s *BenchmarkBaselineTestSuite) TestBenchmarkBaseline()

type BenchmarkCollectorTestSuite

type BenchmarkCollectorTestSuite struct {
	BenchmarkTestSuiteBase
	// contains filtered or unexported fields
}

func (*BenchmarkCollectorTestSuite) SetupSuite

func (s *BenchmarkCollectorTestSuite) SetupSuite()

func (*BenchmarkCollectorTestSuite) TearDownSuite

func (s *BenchmarkCollectorTestSuite) TearDownSuite()

func (*BenchmarkCollectorTestSuite) TestBenchmarkCollector

func (s *BenchmarkCollectorTestSuite) TestBenchmarkCollector()

type BenchmarkTestSuiteBase

type BenchmarkTestSuiteBase struct {
	IntegrationTestSuiteBase
	// contains filtered or unexported fields
}

func (*BenchmarkTestSuiteBase) FetchWorkloadLogs

func (b *BenchmarkTestSuiteBase) FetchWorkloadLogs()

func (*BenchmarkTestSuiteBase) RunCollectorBenchmark

func (s *BenchmarkTestSuiteBase) RunCollectorBenchmark()

func (*BenchmarkTestSuiteBase) RunInitContainer

func (b *BenchmarkTestSuiteBase) RunInitContainer()

func (*BenchmarkTestSuiteBase) SpinBerserker

func (s *BenchmarkTestSuiteBase) SpinBerserker(workload string) (string, error)

func (*BenchmarkTestSuiteBase) StartPerfContainer

func (b *BenchmarkTestSuiteBase) StartPerfContainer(name string, image string, args string)

func (*BenchmarkTestSuiteBase) StartPerfTools

func (b *BenchmarkTestSuiteBase) StartPerfTools()

func (*BenchmarkTestSuiteBase) StopPerfTools

func (b *BenchmarkTestSuiteBase) StopPerfTools()

type CollectorStartupTestSuite

type CollectorStartupTestSuite struct {
	IntegrationTestSuiteBase
}

func (*CollectorStartupTestSuite) SetupSuite

func (s *CollectorStartupTestSuite) SetupSuite()

func (*CollectorStartupTestSuite) TearDownSuite

func (s *CollectorStartupTestSuite) TearDownSuite()

func (*CollectorStartupTestSuite) TestCollectorRunning

func (s *CollectorStartupTestSuite) TestCollectorRunning()

type ConnectionsAndEndpointsTestSuite

type ConnectionsAndEndpointsTestSuite struct {
	IntegrationTestSuiteBase
	Server Container
	Client Container
}

func (*ConnectionsAndEndpointsTestSuite) SetupSuite

func (s *ConnectionsAndEndpointsTestSuite) SetupSuite()

func (*ConnectionsAndEndpointsTestSuite) TearDownSuite

func (s *ConnectionsAndEndpointsTestSuite) TearDownSuite()

func (*ConnectionsAndEndpointsTestSuite) TestConnectionsAndEndpoints

func (s *ConnectionsAndEndpointsTestSuite) TestConnectionsAndEndpoints()

type Container

type Container struct {
	Name              string
	Cmd               string
	ContainerID       string
	IP                string
	ExpectedNetwork   []types.NetworkInfo
	ExpectedEndpoints []types.EndpointInfo
}

type ContainerStat

type ContainerStat struct {
	Timestamp string
	Id        string
	Name      string
	Mem       string
	Cpu       float64
}

type DuplicateEndpointsTestSuite

type DuplicateEndpointsTestSuite struct {
	IntegrationTestSuiteBase
}

func (*DuplicateEndpointsTestSuite) SetupSuite

func (s *DuplicateEndpointsTestSuite) SetupSuite()

func (*DuplicateEndpointsTestSuite) TearDownSuite

func (s *DuplicateEndpointsTestSuite) TearDownSuite()

func (*DuplicateEndpointsTestSuite) TestDuplicateEndpoints

func (s *DuplicateEndpointsTestSuite) TestDuplicateEndpoints()

https://issues.redhat.com/browse/ROX-13628

Endpoints are only reported by collector as a result of procfs scraping, therefore this test is strictly concerned with the scrape interval.

The desired time line of events in this test is the following:

for time (t), and scrape interval (i)

1. Start a process that opens a port, 80 2. Wait for the endpoint to be reported, this is t=0 3. Start a process that opens a different port, 81 4. At t=i (the scrape interval), port 81 should be reported 5. At t=(i+2), kill the process 6. At t=(i+2), start an identical process that opens port 81 7. At t=2i (the second scrape) nothing should be reported.

The test expects only two reported endpoints.

type GperftoolsTestSuite

type GperftoolsTestSuite struct {
	IntegrationTestSuiteBase
}

func (*GperftoolsTestSuite) SetupSuite

func (s *GperftoolsTestSuite) SetupSuite()

func (*GperftoolsTestSuite) TearDownSuite

func (s *GperftoolsTestSuite) TearDownSuite()

func (*GperftoolsTestSuite) TestFetchHeapProfile

func (s *GperftoolsTestSuite) TestFetchHeapProfile()

Verify Gperftools API: * turn heap profiling on * turn heap profiling off * fetch the profile

NOTE: The test will only be performed on supported architectures (only x86_64 at the moment).

type HttpEndpointAvailabilityTestSuite

type HttpEndpointAvailabilityTestSuite struct {
	IntegrationTestSuiteBase
	Port             int
	CollectorOptions collector.StartupOptions
	Endpoints        []string
}

func (*HttpEndpointAvailabilityTestSuite) SetupSuite

func (s *HttpEndpointAvailabilityTestSuite) SetupSuite()

func (*HttpEndpointAvailabilityTestSuite) TearDownSuite

func (s *HttpEndpointAvailabilityTestSuite) TearDownSuite()

func (*HttpEndpointAvailabilityTestSuite) TestAvailability

func (s *HttpEndpointAvailabilityTestSuite) TestAvailability()

type ImageLabelJSONTestSuite

type ImageLabelJSONTestSuite struct {
	IntegrationTestSuiteBase
}

func (*ImageLabelJSONTestSuite) SetupSuite

func (s *ImageLabelJSONTestSuite) SetupSuite()

func (*ImageLabelJSONTestSuite) TearDownSuite

func (s *ImageLabelJSONTestSuite) TearDownSuite()

func (*ImageLabelJSONTestSuite) TestRunImageWithJSONLabel

func (s *ImageLabelJSONTestSuite) TestRunImageWithJSONLabel()

type IntegrationTestSuiteBase

type IntegrationTestSuiteBase struct {
	suite.Suite
	// contains filtered or unexported fields
}

func (*IntegrationTestSuiteBase) AddMetric

func (s *IntegrationTestSuiteBase) AddMetric(key string, value float64)

AddMetric wraps access to the metrics map, to avoid nil pointers lazy initialization is necessary due to limitations around suite setup.

func (*IntegrationTestSuiteBase) AssertProcessInfoEqual

func (s *IntegrationTestSuiteBase) AssertProcessInfoEqual(expected, actual types.ProcessInfo)

func (*IntegrationTestSuiteBase) Collector

Collector returns the current collector object, or initializes a new one if it is nil. This function can be used to get the object before the container is launched, so that Collector settings can be adjusted by individual test suites

func (*IntegrationTestSuiteBase) Executor

Executor returns the current executor object, or initializes a new one if it is nil.

func (*IntegrationTestSuiteBase) GetContainerStats

func (s *IntegrationTestSuiteBase) GetContainerStats() []ContainerStat

func (*IntegrationTestSuiteBase) PrintContainerStats

func (s *IntegrationTestSuiteBase) PrintContainerStats()

func (*IntegrationTestSuiteBase) RegisterCleanup

func (s *IntegrationTestSuiteBase) RegisterCleanup(containers ...string)

RegisterCleanup registers a cleanup function with the testing structures, to cleanup all containers started by a test / suite (provided as args)

func (*IntegrationTestSuiteBase) Sensor

Sensor returns the current mock sensor object, or initializes a new one if it is nil.

func (*IntegrationTestSuiteBase) StartCollector

func (s *IntegrationTestSuiteBase) StartCollector(disableGRPC bool, options *collector.StartupOptions)

StartCollector will start the collector container and optionally start the MockSensor, if disableGRPC is false.

func (*IntegrationTestSuiteBase) StartContainerStats

func (s *IntegrationTestSuiteBase) StartContainerStats()

func (*IntegrationTestSuiteBase) StopCollector

func (s *IntegrationTestSuiteBase) StopCollector()

StopCollector will tear down the collector container and stop the MockSensor if it was started.

func (*IntegrationTestSuiteBase) WritePerfResults

func (s *IntegrationTestSuiteBase) WritePerfResults()

type MissingProcScrapeTestSuite

type MissingProcScrapeTestSuite struct {
	IntegrationTestSuiteBase
}

func (*MissingProcScrapeTestSuite) SetupSuite

func (s *MissingProcScrapeTestSuite) SetupSuite()

func (*MissingProcScrapeTestSuite) TearDownSuite

func (s *MissingProcScrapeTestSuite) TearDownSuite()

func (*MissingProcScrapeTestSuite) TestCollectorRunning

func (s *MissingProcScrapeTestSuite) TestCollectorRunning()

type PerfEventOpenTestSuite

type PerfEventOpenTestSuite struct {
	IntegrationTestSuiteBase
}

func (*PerfEventOpenTestSuite) SetupSuite

func (s *PerfEventOpenTestSuite) SetupSuite()

func (*PerfEventOpenTestSuite) TearDownSuite

func (s *PerfEventOpenTestSuite) TearDownSuite()

func (*PerfEventOpenTestSuite) TestReadingTracepoints

func (s *PerfEventOpenTestSuite) TestReadingTracepoints()

Verify that Collector probe doesn't block tracepoints

type PerformanceResult

type PerformanceResult struct {
	TestName         string
	Timestamp        string
	VmConfig         string
	CollectionMethod string
	Metrics          map[string]float64
	ContainerStats   []ContainerStat
	LoadStartTs      string
	LoadStopTs       string
}

type ProcessListeningOnPortTestSuite

type ProcessListeningOnPortTestSuite struct {
	IntegrationTestSuiteBase
	// contains filtered or unexported fields
}

func (*ProcessListeningOnPortTestSuite) SetupSuite

func (s *ProcessListeningOnPortTestSuite) SetupSuite()

func (*ProcessListeningOnPortTestSuite) TearDownSuite

func (s *ProcessListeningOnPortTestSuite) TearDownSuite()

func (*ProcessListeningOnPortTestSuite) TestProcessListeningOnPort

func (s *ProcessListeningOnPortTestSuite) TestProcessListeningOnPort()

type ProcessNetworkTestSuite

type ProcessNetworkTestSuite struct {
	IntegrationTestSuiteBase
	// contains filtered or unexported fields
}

func (*ProcessNetworkTestSuite) SetupSuite

func (s *ProcessNetworkTestSuite) SetupSuite()

Launches collector Launches gRPC server in insecure mode Launches nginx container Execs into nginx and does a sleep

func (*ProcessNetworkTestSuite) TearDownSuite

func (s *ProcessNetworkTestSuite) TearDownSuite()

func (*ProcessNetworkTestSuite) TestNetworkFlows

func (s *ProcessNetworkTestSuite) TestNetworkFlows()

func (*ProcessNetworkTestSuite) TestProcessLineageInfo

func (s *ProcessNetworkTestSuite) TestProcessLineageInfo()

func (*ProcessNetworkTestSuite) TestProcessViz

func (s *ProcessNetworkTestSuite) TestProcessViz()

type ProcessesAndEndpointsTestSuite

type ProcessesAndEndpointsTestSuite struct {
	IntegrationTestSuiteBase

	Executable        string
	Args              []string
	ExpectedEndpoints []types.EndpointInfo
	ExpectedProcesses []types.ProcessInfo
	ContainerName     string
	// contains filtered or unexported fields
}

func (*ProcessesAndEndpointsTestSuite) SetupSuite

func (s *ProcessesAndEndpointsTestSuite) SetupSuite()

func (*ProcessesAndEndpointsTestSuite) TearDownSuite

func (s *ProcessesAndEndpointsTestSuite) TearDownSuite()

func (*ProcessesAndEndpointsTestSuite) TestProcessesAndEndpoints

func (s *ProcessesAndEndpointsTestSuite) TestProcessesAndEndpoints()

type ProcfsScraperTestSuite

type ProcfsScraperTestSuite struct {
	IntegrationTestSuiteBase
	ServerContainer             string
	TurnOffScrape               bool
	RoxProcessesListeningOnPort bool
	Expected                    []types.EndpointInfo
}

func (*ProcfsScraperTestSuite) SetupSuite

func (s *ProcfsScraperTestSuite) SetupSuite()

Launches nginx container Launches gRPC server in insecure mode Launches collector Note it is important to launch the nginx container before collector, which is the opposite of other tests. The purpose is that we want ProcfsScraper to see the nginx endpoint and we do not want NetworkSignalHandler to see the nginx endpoint.

func (*ProcfsScraperTestSuite) TearDownSuite

func (s *ProcfsScraperTestSuite) TearDownSuite()

func (*ProcfsScraperTestSuite) TestProcfsScraper

func (s *ProcfsScraperTestSuite) TestProcfsScraper()

type RepeatedNetworkFlowTestSuite

type RepeatedNetworkFlowTestSuite struct {
	//The goal with these integration tests is to make sure we report the correct number of
	//networking events. Sometimes if a connection is made multiple times within a short time
	//called an "afterglow" period, we only want to report the connection once.
	IntegrationTestSuiteBase
	ClientContainer        string
	ClientIP               string
	ServerContainer        string
	ServerIP               string
	ServerPort             string
	EnableAfterglow        bool
	AfterglowPeriod        int
	ScrapeInterval         int
	NumMetaIter            int
	NumIter                int
	SleepBetweenCurlTime   int
	SleepBetweenIterations int
	ExpectedActive         int // number of active connections expected
	ExpectedInactive       int // number of inactive connections expected
}

func (*RepeatedNetworkFlowTestSuite) SetupSuite

func (s *RepeatedNetworkFlowTestSuite) SetupSuite()

Launches collector Launches gRPC server in insecure mode Launches nginx container

func (*RepeatedNetworkFlowTestSuite) TearDownSuite

func (s *RepeatedNetworkFlowTestSuite) TearDownSuite()

func (*RepeatedNetworkFlowTestSuite) TestRepeatedNetworkFlow

func (s *RepeatedNetworkFlowTestSuite) TestRepeatedNetworkFlow()

type RingBufferTestSuite

type RingBufferTestSuite struct {
	IntegrationTestSuiteBase
}

func (*RingBufferTestSuite) SetupSuite

func (s *RingBufferTestSuite) SetupSuite()

func (*RingBufferTestSuite) TearDownSuite

func (s *RingBufferTestSuite) TearDownSuite()

func (*RingBufferTestSuite) TestCollectorRunning

func (s *RingBufferTestSuite) TestCollectorRunning()

type RuntimeConfigFileTestSuite

type RuntimeConfigFileTestSuite struct {
	IntegrationTestSuiteBase
	ClientContainer string
}

func (*RuntimeConfigFileTestSuite) AfterTest

func (s *RuntimeConfigFileTestSuite) AfterTest(suiteName, testName string)

func (*RuntimeConfigFileTestSuite) SetupTest

func (s *RuntimeConfigFileTestSuite) SetupTest()

Launches collector and creates the directory for runtime configuration.

func (*RuntimeConfigFileTestSuite) TearDownSuite

func (s *RuntimeConfigFileTestSuite) TearDownSuite()

func (*RuntimeConfigFileTestSuite) TestRuntimeConfigFileDisable

func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileDisable()

func (*RuntimeConfigFileTestSuite) TestRuntimeConfigFileEnable

func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileEnable()

func (*RuntimeConfigFileTestSuite) TestRuntimeConfigFileInvalid

func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileInvalid()

type SocatTestSuite

type SocatTestSuite struct {
	IntegrationTestSuiteBase
	// contains filtered or unexported fields
}

func (*SocatTestSuite) SetupSuite

func (s *SocatTestSuite) SetupSuite()

func (*SocatTestSuite) TearDownSuite

func (s *SocatTestSuite) TearDownSuite()

func (*SocatTestSuite) TestSocat

func (s *SocatTestSuite) TestSocat()

type SymbolicLinkProcessTestSuite

type SymbolicLinkProcessTestSuite struct {
	IntegrationTestSuiteBase
	// contains filtered or unexported fields
}

func (*SymbolicLinkProcessTestSuite) SetupSuite

func (s *SymbolicLinkProcessTestSuite) SetupSuite()

func (*SymbolicLinkProcessTestSuite) TearDownSuite

func (s *SymbolicLinkProcessTestSuite) TearDownSuite()

func (*SymbolicLinkProcessTestSuite) TestSymbolicLinkProcess

func (s *SymbolicLinkProcessTestSuite) TestSymbolicLinkProcess()

type ThreadsTestSuite

type ThreadsTestSuite struct {
	IntegrationTestSuiteBase
}

func (*ThreadsTestSuite) SetupSuite

func (s *ThreadsTestSuite) SetupSuite()

func (*ThreadsTestSuite) TearDownSuite

func (s *ThreadsTestSuite) TearDownSuite()

func (*ThreadsTestSuite) TestThreadExec

func (s *ThreadsTestSuite) TestThreadExec()

Verify that Collector correctly traces threads, even if created via clone3. This should lead to a correct file path, when doing exec from a thread -- instead of an exec target we should see the parent file path.

type UdpNetworkFlow

type UdpNetworkFlow struct {
	IntegrationTestSuiteBase
	DNSEnabled bool
}

func (*UdpNetworkFlow) AfterTest

func (s *UdpNetworkFlow) AfterTest(suiteName, testName string)

func (*UdpNetworkFlow) SetupSuite

func (s *UdpNetworkFlow) SetupSuite()

func (*UdpNetworkFlow) TearDownSubTest

func (s *UdpNetworkFlow) TearDownSubTest()

func (*UdpNetworkFlow) TearDownSuite

func (s *UdpNetworkFlow) TearDownSuite()

func (*UdpNetworkFlow) TestMultipleDestinations

func (s *UdpNetworkFlow) TestMultipleDestinations()

func (*UdpNetworkFlow) TestMultipleSources

func (s *UdpNetworkFlow) TestMultipleSources()

func (*UdpNetworkFlow) TestUdpNetorkflow

func (s *UdpNetworkFlow) TestUdpNetorkflow()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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