Skip to content

Commit

Permalink
Tracing: Fix test skip messages
Browse files Browse the repository at this point in the history
Some test are skipped on older kernels. The skip function takes a
message. It appears that a single message was copy and pasted to
multiple tests without updating the message. This commit updates the
messages to match the skipped tests.

Signed-off-by: Kevin Sheldrake <[email protected]>
  • Loading branch information
kevsecurity committed Apr 9, 2024
1 parent 14be4af commit 78ea803
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/sensors/tracing/kprobe_amd64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:

func TestKprobeListSyscallDups(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestKprobeListSyscallDups requires at least 5.3.0 version")
}
myPid := observertesthelper.GetMyPid()
pidStr := strconv.Itoa(int(myPid))
Expand Down
8 changes: 4 additions & 4 deletions pkg/sensors/tracing/kprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4391,7 +4391,7 @@ func testMaxData(t *testing.T, data []byte, checker *ec.UnorderedEventChecker, c

func TestKprobeWriteMaxDataTrunc(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestKprobeWriteMaxDataTrunc requires at least 5.3.0 version")
}
_, fd2, fdString := createTestFile(t)
myPid := observertesthelper.GetMyPid()
Expand Down Expand Up @@ -4454,7 +4454,7 @@ spec:

func TestKprobeWriteMaxData(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestKprobeWriteMaxData requires at least 5.3.0 version")
}
_, fd2, fdString := createTestFile(t)
myPid := observertesthelper.GetMyPid()
Expand Down Expand Up @@ -4513,7 +4513,7 @@ spec:

func TestKprobeWriteMaxDataFull(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestKprobeWriteMaxDataFull requires at least 5.3.0 version")
}
_, fd2, fdString := createTestFile(t)
myPid := observertesthelper.GetMyPid()
Expand Down Expand Up @@ -5784,7 +5784,7 @@ spec:

func TestKprobeListSyscallDupsRange(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestKprobeListSyscallDupsRange requires at least 5.3.0 version")
}
myPid := observertesthelper.GetMyPid()
pidStr := strconv.Itoa(int(myPid))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sensors/tracing/tracepoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func testListSyscallsDupsRange(t *testing.T, checker *eventchecker.UnorderedEven

func TestTracepointListSyscallDupsRange(t *testing.T) {
if !kernels.MinKernelVersion("5.3.0") {
t.Skip("TestCopyFd requires at least 5.3.0 version")
t.Skip("TestTracepointListSyscallDupsRange requires at least 5.3.0 version")
}
myPid := observertesthelper.GetMyPid()
pidStr := strconv.Itoa(int(myPid))
Expand Down

0 comments on commit 78ea803

Please sign in to comment.