Documentation ¶
Index ¶
- Constants
- func NewMonitorStartCommand(opts ...StartMonitorOpt) command.StartMonitor
- func WithEnableMondel() sensorOpt
- func WithSensorArtifactsDir(dir string) sensorOpt
- func WithSensorCapabilities(caps ...string) sensorOpt
- func WithSensorLifecycleHook(cmd string) sensorOpt
- func WithSensorLogsToFile() sensorOpt
- func WithStopSignal(sig syscall.Signal) sensorOpt
- func WithoutSensorCapabilities(caps ...string) sensorOpt
- type Sensor
- func (s *Sensor) AssertArtifactsArchiveContains(t *testing.T, ctx context.Context, filename ...string)
- func (s *Sensor) AssertMondelIncludesFiles(t *testing.T, filepath ...string)
- func (s *Sensor) AssertMondelNotIncludesFiles(t *testing.T, filepath ...string)
- func (s *Sensor) AssertReportAndMondelFileListsMatch(t *testing.T)
- func (s *Sensor) AssertReportIncludesFiles(t *testing.T, filepath ...string)
- func (s *Sensor) AssertReportNotIncludesFiles(t *testing.T, filepath ...string)
- func (s *Sensor) AssertSensorEventsFileContains(t *testing.T, ctx context.Context, expected ...event.Type)
- func (s *Sensor) AssertSensorLogsContain(t *testing.T, ctx context.Context, what ...string)
- func (s *Sensor) AssertTargetAppLogsContain(t *testing.T, ctx context.Context, what ...string)
- func (s *Sensor) AssertTargetAppLogsEqualTo(t *testing.T, ctx context.Context, what string)
- func (s *Sensor) AssertTargetAppStderrFileEqualsTo(t *testing.T, ctx context.Context, expected string)
- func (s *Sensor) AssertTargetAppStdoutFileEqualsTo(t *testing.T, ctx context.Context, expected string)
- func (s *Sensor) Cleanup(t *testing.T, ctx context.Context)
- func (s *Sensor) ContainerLogs(ctx context.Context) (string, error)
- func (s *Sensor) ContainerLogsOrFail(t *testing.T, ctx context.Context) string
- func (s *Sensor) DownloadArtifacts(ctx context.Context) error
- func (s *Sensor) DownloadArtifactsOrFail(t *testing.T, ctx context.Context)
- func (s *Sensor) ExecuteControlCommand(ctx context.Context, cmd control.Command) error
- func (s *Sensor) ExecuteControlCommandOrFail(t *testing.T, ctx context.Context, cmd control.Command)
- func (s *Sensor) ExpectEvent(t *testing.T, name event.Type)
- func (s *Sensor) PrintState(ctx context.Context)
- func (s *Sensor) SendCommand(ctx context.Context, cmd command.Message) error
- func (s *Sensor) SendStartCommand(ctx context.Context, cmdOverride ...command.StartMonitor) error
- func (s *Sensor) SendStartCommandOrFail(t *testing.T, ctx context.Context, cmdOverride ...command.StartMonitor)
- func (s *Sensor) SendStopCommand(ctx context.Context) error
- func (s *Sensor) SendStopCommandOrFail(t *testing.T, ctx context.Context)
- func (s *Sensor) SensorLogs(ctx context.Context) (string, error)
- func (s *Sensor) SensorLogsOrFail(t *testing.T, ctx context.Context) string
- func (s *Sensor) Shutdown(ctx context.Context) error
- func (s *Sensor) ShutdownOrFail(t *testing.T, ctx context.Context)
- func (s *Sensor) Signal(ctx context.Context, sig syscall.Signal) error
- func (s *Sensor) SignalOrFail(t *testing.T, ctx context.Context, sig syscall.Signal)
- func (s *Sensor) StartControlled(ctx context.Context) error
- func (s *Sensor) StartControlledOrFail(t *testing.T, ctx context.Context)
- func (s *Sensor) StartStandalone(ctx context.Context, runArgs []string, cmdOverride ...command.StartMonitor) error
- func (s *Sensor) StartStandaloneOrFail(t *testing.T, ctx context.Context, runArgs []string, ...)
- func (s *Sensor) Wait(ctx context.Context) (int, error)
- func (s *Sensor) WaitForEvent(ctx context.Context, evt event.Type) error
- func (s *Sensor) WaitForEventOrFail(t *testing.T, ctx context.Context, evt event.Type)
- func (s *Sensor) WaitOrFail(t *testing.T, ctx context.Context) int
- type StartMonitorOpt
Constants ¶
View Source
const ( // Intentionally duplicating values here since to make sure a refactoing // of the paths on the sensor side won't be unnoticed. CommandsFileName = "commands.json" SensorLogFileName = "sensor.log" MondelFileName = "mondel.ndjson" AppStdoutFileName = "app_stdout.log" AppStderrFileName = "app_stderr.log" EventsFileName = "events.json" )
Variables ¶
This section is empty.
Functions ¶
func NewMonitorStartCommand ¶
func NewMonitorStartCommand(opts ...StartMonitorOpt) command.StartMonitor
func WithEnableMondel ¶
func WithEnableMondel() sensorOpt
func WithSensorArtifactsDir ¶
func WithSensorArtifactsDir(dir string) sensorOpt
func WithSensorCapabilities ¶
func WithSensorCapabilities(caps ...string) sensorOpt
func WithSensorLifecycleHook ¶
func WithSensorLifecycleHook(cmd string) sensorOpt
func WithSensorLogsToFile ¶
func WithSensorLogsToFile() sensorOpt
func WithStopSignal ¶
func WithoutSensorCapabilities ¶
func WithoutSensorCapabilities(caps ...string) sensorOpt
Types ¶
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
func NewSensorOrFail ¶
func (*Sensor) AssertArtifactsArchiveContains ¶
func (*Sensor) AssertMondelIncludesFiles ¶
func (*Sensor) AssertMondelNotIncludesFiles ¶
func (*Sensor) AssertReportAndMondelFileListsMatch ¶
func (*Sensor) AssertReportIncludesFiles ¶
func (*Sensor) AssertReportNotIncludesFiles ¶
func (*Sensor) AssertSensorEventsFileContains ¶
func (s *Sensor) AssertSensorEventsFileContains( t *testing.T, ctx context.Context, expected ...event.Type, )
Checks the presense of the expected events AND the occurrence order.
func (*Sensor) AssertSensorLogsContain ¶
func (*Sensor) AssertTargetAppLogsContain ¶
func (*Sensor) AssertTargetAppLogsEqualTo ¶
func (*Sensor) AssertTargetAppStderrFileEqualsTo ¶
func (*Sensor) AssertTargetAppStdoutFileEqualsTo ¶
func (*Sensor) ContainerLogsOrFail ¶
func (*Sensor) DownloadArtifactsOrFail ¶
func (*Sensor) ExecuteControlCommand ¶
func (*Sensor) ExecuteControlCommandOrFail ¶
func (*Sensor) PrintState ¶
func (*Sensor) SendCommand ¶
func (*Sensor) SendStartCommand ¶
func (*Sensor) SendStartCommandOrFail ¶
func (*Sensor) SendStopCommandOrFail ¶
func (*Sensor) SensorLogsOrFail ¶
func (*Sensor) SignalOrFail ¶
func (*Sensor) StartControlledOrFail ¶
func (*Sensor) StartStandalone ¶
func (*Sensor) StartStandaloneOrFail ¶
func (*Sensor) WaitForEvent ¶
func (*Sensor) WaitForEventOrFail ¶
type StartMonitorOpt ¶
type StartMonitorOpt func(*command.StartMonitor)
func WithAppNameArgs ¶
func WithAppNameArgs(name string, arg ...string) StartMonitorOpt
func WithAppStderrToFile ¶
func WithAppStderrToFile() StartMonitorOpt
func WithAppStdoutToFile ¶
func WithAppStdoutToFile() StartMonitorOpt
func WithAppUser ¶
func WithAppUser(user string) StartMonitorOpt
func WithPreserves ¶
func WithPreserves(path ...string) StartMonitorOpt
func WithSaneDefaults ¶
func WithSaneDefaults() StartMonitorOpt
Click to show internal directories.
Click to hide internal directories.