Skip to content

Commit

Permalink
tetragon: Fix TestKprobeDentryPath test
Browse files Browse the repository at this point in the history
There's bug in setting up the check variable where we take the
mountpoint instead.

Signed-off-by: Jiri Olsa <[email protected]>
  • Loading branch information
olsajiri committed Feb 28, 2025
1 parent 8f43e13 commit 4c67e09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/sensors/tracing/kprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7317,7 +7317,7 @@ func TestKprobeDentryPath(t *testing.T) {
check := file.Name()
for _, info := range infos {
if len(info.MountPoint) > 1 && strings.HasPrefix(file.Name(), info.MountPoint) {
check = info.MountPoint[len(info.MountPoint):]
check = check[len(info.MountPoint):]
break
}
}
Expand All @@ -7342,14 +7342,15 @@ spec:
`
createCrdFile(t, hook)

t.Logf("Removing file %s, mode %s, check %s\n", file.Name(), pathr.FilePathModeToStr(syscall.O_RDWR), check)

obs, err := observertesthelper.GetDefaultObserverWithFile(t, ctx, testConfigFile, tus.Conf().TetragonLib)
if err != nil {
t.Fatalf("GetDefaultObserverWithFile error: %s", err)
}
observertesthelper.LoopEvents(ctx, t, &doneWG, &readyWG, obs)
readyWG.Wait()

t.Logf("Removing file %s, mode %s, check %s\n", file.Name(), pathr.FilePathModeToStr(syscall.O_RDWR), check)
syscall.Unlink(file.Name())

kpChecker := ec.NewProcessKprobeChecker("").
Expand Down

0 comments on commit 4c67e09

Please sign in to comment.