diff --git a/pkg/sensors/tracing/kprobe_threads_test.go b/pkg/sensors/tracing/kprobe_threads_test.go index 8096a787c61..e2a3d78cdbe 100644 --- a/pkg/sensors/tracing/kprobe_threads_test.go +++ b/pkg/sensors/tracing/kprobe_threads_test.go @@ -18,6 +18,7 @@ import ( "github.com/cilium/tetragon/pkg/logger" sm "github.com/cilium/tetragon/pkg/matchers/stringmatcher" "github.com/cilium/tetragon/pkg/observer/observertesthelper" + "github.com/cilium/tetragon/pkg/reader/caps" "github.com/cilium/tetragon/pkg/testutils" tus "github.com/cilium/tetragon/pkg/testutils/sensors" "github.com/stretchr/testify/assert" @@ -90,10 +91,13 @@ spec: cti.AssertPidsTids(t) + myCaps := ec.NewCapabilitiesChecker().FromCapabilities(caps.GetCurrentCapabilities()) + parentCheck := ec.NewProcessChecker(). WithBinary(sm.Suffix("threads-tester")). WithPid(cti.ParentPid). - WithTid(cti.ParentTid) + WithTid(cti.ParentTid). + WithCap(myCaps) execCheck := ec.NewProcessExecChecker(""). WithProcess(parentCheck) @@ -104,7 +108,8 @@ spec: child1Checker := ec.NewProcessChecker(). WithBinary(sm.Suffix("threads-tester")). WithPid(cti.Child1Pid). - WithTid(cti.Child1Tid) + WithTid(cti.Child1Tid). + WithCap(myCaps) child1KpChecker := ec.NewProcessKprobeChecker(""). WithProcess(child1Checker).WithParent(parentCheck) @@ -112,7 +117,8 @@ spec: thread1Checker := ec.NewProcessChecker(). WithBinary(sm.Suffix("threads-tester")). WithPid(cti.Thread1Pid). - WithTid(cti.Thread1Tid) + WithTid(cti.Thread1Tid). + WithCap(myCaps) thread1KpChecker := ec.NewProcessKprobeChecker(""). WithProcess(thread1Checker).WithParent(parentCheck)