Documentation ¶
Index ¶
- Variables
- func CheckSensorLoad(sensors []*sensors.Sensor, sensorMaps []SensorMap, sensorProgs []SensorProg, ...)
- func CheckSensorLoadBase(t *testing.T, sensors []*sensors.Sensor, sensorMaps []SensorMap, ...)
- func LoadInitialSensor(t *testing.T)
- func LoadSensor(t *testing.T, sensori sensors.SensorIface)
- func TestSensorsRun(m *testing.M, sensorName string) int
- func TetragonBpfPath() string
- type Config
- type ProgMatch
- type SensorMap
- type SensorProg
- type TestSensorManager
- func (tsm *TestSensorManager) AddAndEnableSensor(ctx context.Context, t *testing.T, sensor *sensors.Sensor, sensorName string)
- func (tsm *TestSensorManager) AddAndEnableSensors(ctx context.Context, t *testing.T, targets []*sensors.Sensor)
- func (tsm *TestSensorManager) DisableSensors(ctx context.Context, t *testing.T, targets []*sensors.Sensor)
- func (tsm *TestSensorManager) EnableSensors(ctx context.Context, t *testing.T, targets []*sensors.Sensor)
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefaults = Config{ TetragonLib: filepath.Join(TetragonBpfPath(), "objs"), SelfBinary: filepath.Base(os.Args[0]), CmdWaitTime: 60000 * time.Millisecond, DisableTetragonLogs: false, Debug: false, Trace: false, }
Functions ¶
func CheckSensorLoad ¶
func CheckSensorLoadBase ¶ added in v1.3.2
func CheckSensorLoadBase(t *testing.T, sensors []*sensors.Sensor, sensorMaps []SensorMap, sensorProgs []SensorProg, baseMaps []SensorMap, baseProgs []SensorProg)
func LoadInitialSensor ¶ added in v1.3.2
func LoadSensor ¶
func LoadSensor(t *testing.T, sensori sensors.SensorIface)
LoadSensor is a helper for loading a sensor in tests
Types ¶
type Config ¶
type Config struct { TetragonLib string SelfBinary string CmdWaitTime time.Duration DisableTetragonLogs bool Debug bool Trace bool }
Conf is configuration for testing sensors. It is intialized in TestSensorsRun() so all sensors test should call this function in their TestMain
type SensorProg ¶
type SensorProg struct { Name string Type ebpf.ProgramType NotIn bool Match ProgMatch }
type TestSensorManager ¶
TestSensorManager sensor manager used in tests
func (*TestSensorManager) AddAndEnableSensor ¶
func (tsm *TestSensorManager) AddAndEnableSensor( ctx context.Context, t *testing.T, sensor *sensors.Sensor, sensorName string, )
AddAndEnableSensor is a helper function that adds and enables a new sensor
func (*TestSensorManager) AddAndEnableSensors ¶
func (tsm *TestSensorManager) AddAndEnableSensors( ctx context.Context, t *testing.T, targets []*sensors.Sensor, )
AddAndEnableSensor is a helper function that adds and enables a new sensor
func (*TestSensorManager) DisableSensors ¶
func (tsm *TestSensorManager) DisableSensors( ctx context.Context, t *testing.T, targets []*sensors.Sensor, )
EnableSensors is a helper function that enables a list of sensors
func (*TestSensorManager) EnableSensors ¶
func (tsm *TestSensorManager) EnableSensors( ctx context.Context, t *testing.T, targets []*sensors.Sensor, )
EnableSensors is a helper function that enables a list of sensors
Click to show internal directories.
Click to hide internal directories.