Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(pkg,tests): port falco driver loader tests to use falcoctl. #34

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Nov 29, 2023

This will fail for Falco master; this PR should let falcosecurity/falco#2905 CI pass fine.

@poiana poiana added the size/L label Nov 29, 2023
@FedeDP FedeDP changed the title new(pkg,tests): port falco driver loader tests to use falcoctl. wip: new(pkg,tests): port falco driver loader tests to use falcoctl. Nov 29, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a falco-driver-loader tester at all now that driver-loader is a feature of falcoctl.

loaderRes := falcodriverloader.Test(
tests.NewFalcoDriverLoaderExecutableRunner(t),
falcodriverloader.WithArgs("bpf", "--compile"),
// First, configure falcoctl driver
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 steps:

  • falcoctl driver config --type X
  • falcoctl driver install

// We expect the probe to be symlinked in '/root/.falco/falco-bpf.o'
assert.Regexp(t, `Success: eBPF probe symlinked`, loaderRes.Stdout())
// We expect the probe to be succesfully built and copied to /root/.falco/falco-bpf.o
assert.Regexp(t, `Probe successfully built.`, loaderRes.Stdout())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New success message.


// Now running Falco with `FALCO_BPF_PROBE=/root/.falco/falco-bpf.o` we should be able to run the bpf driver
falcoRes := falco.Test(
tests.NewFalcoExecutableRunner(t),
falco.WithStopAfter(3*time.Second),
falco.WithEnvVars(map[string]string{"FALCO_BPF_PROBE": "/root/.falco/falco-bpf.o"}),
falco.WithArgs("-o", "engine.kind=ebpf"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set new Falco engine options to run with ebpf.

@FedeDP FedeDP changed the title wip: new(pkg,tests): port falco driver loader tests to use falcoctl. new(pkg,tests): port falco driver loader tests to use falcoctl. Nov 30, 2023
@FedeDP
Copy link
Contributor Author

FedeDP commented Nov 30, 2023

/hold until we are ready to merge falcosecurity/falco#2905

@poiana poiana added the lgtm label Dec 1, 2023
@poiana
Copy link

poiana commented Dec 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Dec 1, 2023
@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 6, 2023

Let's go in with this. I will bump the falcosecurity/testing submodule in my Falco PR falcosecurity/falco#2905 and test the changes.

@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 6, 2023

/unhold

@poiana poiana merged commit b92b6fa into falcosecurity:main Dec 6, 2023
2 checks passed
@FedeDP FedeDP deleted the new/falcoctl_driver_loader branch December 6, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants