Skip to content

Commit

Permalink
tetragon: Update TestKprobeMatchBinaries
Browse files Browse the repository at this point in the history
Adding tests for Postix and NotPostfix operators

Signed-off-by: Andrei Fedotov <anfedotoff@yandex-team.ru>
  • Loading branch information
anfedotoff committed Jul 19, 2024
1 parent 524b3a8 commit 1f843f2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/sensors/tracing/kprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3884,6 +3884,18 @@ func TestKprobeMatchBinaries(t *testing.T) {
}
matchBinariesTest(t, "NotPrefix", []string{"/usr/bin/t"}, createBinariesChecker("/usr/bin/head", "/etc/passwd"))
})
t.Run("Postfix", func(t *testing.T) {
if !kernels.EnableLargeProgs() {
t.Skip(skipMatchBinariesPrefix)
}
matchBinariesTest(t, "Postfix", []string{"bin/tail"}, createBinariesChecker("/usr/bin/tail", "/etc/passwd"))
})
t.Run("NotPostfix", func(t *testing.T) {
if !kernels.EnableLargeProgs() {
t.Skip(skipMatchBinariesPrefix)
}
matchBinariesTest(t, "NotPostfix", []string{"bin/tail"}, createBinariesChecker("/usr/bin/head", "/etc/passwd"))
})
}

// matchBinariesPerfringTest checks that the matchBinaries do correctly
Expand Down

0 comments on commit 1f843f2

Please sign in to comment.