Skip to content

Commit

Permalink
update: sync command line options with Falco 0.38.0
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <[email protected]>
  • Loading branch information
Andreagit97 committed Feb 15, 2024
1 parent ae3950a commit b021273
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions pkg/falco/tester_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ func WithAllEvents() TestOption {
}
}

// WithCaptureFile runs Falco reading events from a capture file through the `-e` option.
// WithCaptureFile runs Falco reading events from a capture file through the `-o engine.kind=replay` option.
func WithCaptureFile(f run.FileAccessor) TestOption {
return func(o *testOptions) {
o.args = removeFromArgs(o.args, "-e", 1)
o.args = append(o.args, "-e", f.Name())
o.args = append(o.args, "-o", "engine.kind=replay", "-o", fmt.Sprintf("engine.replay.capture_file=%s", f.Name()))
o.files = append(o.files, f)
}
}
Expand Down
2 changes: 0 additions & 2 deletions tests/falco/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import (
// --markdown, -N, --gvisor-generate-config, --page-size
// Metadata collection and container runtimes:
// --cri, --disable-cri-async, -k, --k8s-api, -K, --k8s-api-cert, --k8s-node, -m, --mesos-api
// Falco event collection modes:
// -g, --gvisor-config, --gvisor-root, -u, --userspace, --modern-bpf
// Changers of Falco's behavior:
// --disable-source, --enable-source, -A, -d, --daemon, -P, --pidfile,
// -p, --print, -b, --print-base64, -S, --snaplen,
Expand Down
3 changes: 1 addition & 2 deletions tests/falco/miscs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ import (

// todo(jasondellaluce): implement tests for the non-covered Falco config fields:
// watch_config_files, libs_logger, buffered_outputs, syscall_event_timeouts,
// syscall_buf_size_preset, modern_bpf, output_timeout, outputs
// syslog_output, file_output, stdout_output, webserver, program_output,
// http_output, metadata_download
// http_output, metadata_download, output_timeout, outputs
//
// todo(jasondellaluce): test Falco behavior on environment variables and their
// priorities in combination with their args/configs/cmds counterparts:
Expand Down
5 changes: 3 additions & 2 deletions tests/falcodriverloader/drivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ limitations under the License.
package testfalcodriverloader

import (
"github.com/falcosecurity/testing/pkg/falcoctl"
"testing"
"time"

"github.com/falcosecurity/testing/pkg/falcoctl"

"github.com/falcosecurity/testing/pkg/falco"
"github.com/falcosecurity/testing/tests"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -106,7 +107,7 @@ func TestFalcoModernBpf(t *testing.T) {
falcoRes := falco.Test(
tests.NewFalcoExecutableRunner(t),
falco.WithStopAfter(3*time.Second),
falco.WithArgs("--modern-bpf"),
falco.WithArgs("-o", "engine.kind=modern_ebpf"),
)
assert.NoError(t, falcoRes.Err(), "%s", falcoRes.Stderr())
assert.Equal(t, 0, falcoRes.ExitCode())
Expand Down

0 comments on commit b021273

Please sign in to comment.