observertesthelper

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerRun

func DockerRun(tb testing.TB, args ...string) (containerId string)

dockerRun starts a new docker container in the background. The container will be killed and removed on test cleanup. It returns the containerId on success, or an error if spawning the container failed.

func ExecWGCurl

func ExecWGCurl(readyWG *sync.WaitGroup, retries uint, args ...string) error

func GetDefaultObserver

func GetDefaultObserver(tb testing.TB, ctx context.Context, lib string, opts ...TestOption) (*observer.Observer, error)

func GetDefaultObserverWithBase

func GetDefaultObserverWithBase(tb testing.TB, ctx context.Context, b *sensors.Sensor, file, lib string, opts ...TestOption) (*observer.Observer, error)

func GetDefaultObserverWithConfig

func GetDefaultObserverWithConfig(tb testing.TB, ctx context.Context, config, lib string, opts ...TestOption) (*observer.Observer, error)

func GetDefaultObserverWithFile

func GetDefaultObserverWithFile(tb testing.TB, ctx context.Context, file, lib string, opts ...TestOption) (*observer.Observer, error)

func GetDefaultObserverWithWatchers

func GetDefaultObserverWithWatchers(tb testing.TB, ctx context.Context, base *sensors.Sensor, opts ...TestOption) (*observer.Observer, error)

func GetDefaultSensorsWithFile

func GetDefaultSensorsWithFile(tb testing.TB, file, lib string, opts ...TestOption) ([]*sensors.Sensor, error)

func GetMyPid

func GetMyPid() uint32

func LoopEvents

func LoopEvents(ctx context.Context, tb testing.TB, doneWG, readyWG *sync.WaitGroup, obs *observer.Observer)

func WaitForProcess

func WaitForProcess(process string) error

Used to wait for a process to start, we do a lookup on PROCFS because this may be called before obs is created.

func WriteConfigFile

func WriteConfigFile(fileName, config string) error

Types

type TestOption

type TestOption func(*TestOptions)

func WithAllowList

func WithAllowList(allowList *tetragon.Filter) TestOption

func WithConfig

func WithConfig(config string) TestOption

func WithDenyList

func WithDenyList(denyList *tetragon.Filter) TestOption

func WithLib

func WithLib(lib string) TestOption

func WithMyPid

func WithMyPid() TestOption

Filter for the gotest process and its children in the export

type TestOptions

type TestOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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