From f12a851953e99328f743a767c9cb45af4f6f285b Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Fri, 19 Jan 2024 19:50:27 +0100 Subject: [PATCH] [CWS] no trace_pipe with ebpfless (#22190) [CWS] no trace_pipe with ebpfless --- pkg/security/tests/module_tester.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/security/tests/module_tester.go b/pkg/security/tests/module_tester.go index 9ed8569e345ac..f9466b4b4f6c3 100644 --- a/pkg/security/tests/module_tester.go +++ b/pkg/security/tests/module_tester.go @@ -1001,8 +1001,11 @@ func newTestModule(t testing.TB, macroDefs []*rules.MacroDefinition, ruleDefs [] testMod.cmdWrapper = cmdWrapper testMod.t = t testMod.opts.dynamicOpts = opts.dynamicOpts - if testMod.tracePipe, err = testMod.startTracing(); err != nil { - return testMod, err + + if !opts.staticOpts.enableEBPFLess { + if testMod.tracePipe, err = testMod.startTracing(); err != nil { + return testMod, err + } } if opts.staticOpts.preStartCallback != nil { @@ -1111,8 +1114,10 @@ func newTestModule(t testing.TB, macroDefs []*rules.MacroDefinition, ruleDefs [] opts.staticOpts.preStartCallback(testMod) } - if testMod.tracePipe, err = testMod.startTracing(); err != nil { - return nil, err + if !opts.staticOpts.enableEBPFLess { + if testMod.tracePipe, err = testMod.startTracing(); err != nil { + return nil, err + } } if opts.staticOpts.snapshotRuleMatchHandler != nil {