Documentation ¶
Index ¶
Constants ¶
const ( // DefaultMaxDuration is the default max duration of a falcoctl run DefaultMaxDuration = time.Second * 30 // // DefaultExecutable is the default path of the falcoctl executable // when installed from a Falco package DefaultExecutable = "/usr/bin/falcoctl" // // DefaultLocalExecutable is the default path of the falcoctl executable // when installed manually from a released falcoctl package DefaultLocalExecutable = "/usr/local/bin/falcoctl" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestOption ¶
type TestOption func(*testOptions)
TestOption is an option for testing falcoctl
func WithArgs ¶
func WithArgs(args ...string) TestOption
WithArgs runs falcoctl with the given arguments.
func WithConfig ¶
func WithConfig(config run.FileAccessor) TestOption
WithConfig runs falcoctl with the given config file through the `--config` option.
func WithPluginsDir ¶
func WithPluginsDir(dir string) TestOption
WithPluginsDir runs falcoctl with the given custom plugins dir file through the `--plugins-dir` option.
func WithRulesFilesDir ¶
func WithRulesFilesDir(dir string) TestOption
WithRulesFilesDir runs falcoctl with the given custom rules files dir file through the `--rulesfiles-dir` option.
type TestOutput ¶
type TestOutput struct {
// contains filtered or unexported fields
}
TestOutput is the output of a falcoctl test run
func Test ¶
func Test(runner run.Runner, options ...TestOption) *TestOutput
Test runs a Falco runner with the given test options, and produces an output representing the outcome of the run.
func (*TestOutput) DurationExceeded ¶
func (t *TestOutput) DurationExceeded() bool
DurationExceeded returns true if the falcoctl run exceeded the expected duration or if the context had expired.
func (*TestOutput) Err ¶
func (t *TestOutput) Err() error
Err returns a non-nil error in case of issues when running falcoctl.
func (*TestOutput) ExitCode ¶
func (t *TestOutput) ExitCode() int
ExitCode returns the numeric exit code of the falcoctl process.
func (*TestOutput) Stderr ¶
func (t *TestOutput) Stderr() string
Stderr returns a string containing the stderr output of the falcoctl run.
func (*TestOutput) Stdout ¶
func (t *TestOutput) Stdout() string
Stdout returns a string containing the stdout output of the falcoctl run.