Documentation
¶
Index ¶
- func CaptureLog(t *testing.T, l *logrus.Logger)
- func ContribPath(fname string) string
- func DoneWithExportFile(t *testing.T) error
- func GetExportFilename(t *testing.T) (string, error)
- func GetSpecFromTemplate(tmplname string, data interface{}) (string, error)
- func GetTgRuntimeConf() (*confmap.TetragonConfValue, error)
- func ReadTgRuntimeConf(mapDir string) (*confmap.TetragonConfValue, error)
- func UpdateTgRuntimeConf(mapDir string, v *confmap.TetragonConfValue) error
- type CmdBufferedPipes
- type CmdPipes
- type ExportFile
- type LineParser
- type LogCapturer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureLog ¶
CaptureLog redirects logrus output to testing.Log
func ContribPath ¶
ContribPath retrieves contrib path (useful to find scripts and other files)
func DoneWithExportFile ¶ added in v0.8.4
DoneWithExportFile: marks the export file to be deleted It is the tester's responsibility to call this function
func GetExportFilename ¶
GetExportFilename return export filename for test
func GetSpecFromTemplate ¶
GetSpecFromTemplate creates a file bsed on the given template
func GetTgRuntimeConf ¶ added in v0.8.4
func GetTgRuntimeConf() (*confmap.TetragonConfValue, error)
func ReadTgRuntimeConf ¶ added in v0.8.4
func ReadTgRuntimeConf(mapDir string) (*confmap.TetragonConfValue, error)
func UpdateTgRuntimeConf ¶ added in v0.8.4
func UpdateTgRuntimeConf(mapDir string, v *confmap.TetragonConfValue) error
Test `tg_conf_map` BPF MAP with explicit values
Types ¶
type CmdBufferedPipes ¶
CmdBufferedPipes wraps stdout and stderr in a bufio.Reader
func NewCmdBufferedPipes ¶
func NewCmdBufferedPipes(cmd *exec.Cmd) (*CmdBufferedPipes, error)
func (*CmdBufferedPipes) Close ¶
func (cbp *CmdBufferedPipes) Close()
func (*CmdBufferedPipes) ParseAndLogCmdOutput ¶
func (cbp *CmdBufferedPipes) ParseAndLogCmdOutput( t *testing.T, parseOut LineParser, parseErr LineParser, ) *sync.WaitGroup
ParseAndLogCmdOutput will log command output using t.Log, and also call the lineparser functions for each line. This will happen in two goroutines. It returns a waitgroup for them finishing.
type CmdPipes ¶
type CmdPipes struct {
Stdout, Stderr io.ReadCloser
Stdin io.WriteCloser
}
CmdPipes maintains pipes for stdout, stderr, and stdin
func NewCmdPipes ¶
NewCmdPipes returns a new CmdPipes
type ExportFile ¶
func CreateExportFile ¶
func CreateExportFile(t *testing.T) (*ExportFile, error)
CreateExportFile creates an export file for a test. It returns an ExportFile that has a .Close() method, that will be called by the observer loop. This function is responsible to delete the file. For a file to be deleted, the tester should call DoneWithExportFile() if the test was successful.
func (*ExportFile) Close ¶
func (f *ExportFile) Close() error
Close() is called by the observer loop when it exits, and is responsible for deleting the file.