From 1b9bcda1ba3750a192768d160bce9c8d96d8b35a Mon Sep 17 00:00:00 2001 From: RoiKol Date: Thu, 2 Nov 2023 19:31:02 +0200 Subject: [PATCH] fixup! feat(tests): add io_uring tests --- .../e2e-io_uring_submit_req.go | 16 --------------- tests/e2e-inst-signatures/e2e-io_write.go | 20 ------------------- tests/e2e-inst-test.sh | 2 +- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/tests/e2e-inst-signatures/e2e-io_uring_submit_req.go b/tests/e2e-inst-signatures/e2e-io_uring_submit_req.go index 89c9a1f7955a..4808093dd518 100644 --- a/tests/e2e-inst-signatures/e2e-io_uring_submit_req.go +++ b/tests/e2e-inst-signatures/e2e-io_uring_submit_req.go @@ -3,7 +3,6 @@ package main import ( "fmt" - "github.com/aquasecurity/tracee/signatures/helpers" "github.com/aquasecurity/tracee/types/detect" "github.com/aquasecurity/tracee/types/protocol" "github.com/aquasecurity/tracee/types/trace" @@ -43,21 +42,6 @@ func (sig *e2eIoUringSumitReq) OnEvent(event protocol.Event) error { switch eventObj.EventName { case "io_uring_submit_req": - path, err := helpers.GetTraceeStringArgumentByName(eventObj, "path") - if err != nil { - return err - } - - opcode, err := helpers.GetTraceeStringArgumentByName(eventObj, "opcode") - if err != nil { - return err - } - - // check expected values from test for detection - - if eventObj.ProcessName != "io_uring_writev" || opcode != "IORING_OP_WRITEV" || path != "/tmp/io_uring_writev.txt" { - return nil - } m, _ := sig.GetMetadata() diff --git a/tests/e2e-inst-signatures/e2e-io_write.go b/tests/e2e-inst-signatures/e2e-io_write.go index e2d89b9fab83..a0bdd0367fe4 100644 --- a/tests/e2e-inst-signatures/e2e-io_write.go +++ b/tests/e2e-inst-signatures/e2e-io_write.go @@ -3,7 +3,6 @@ package main import ( "fmt" - "github.com/aquasecurity/tracee/signatures/helpers" "github.com/aquasecurity/tracee/types/detect" "github.com/aquasecurity/tracee/types/protocol" "github.com/aquasecurity/tracee/types/trace" @@ -43,25 +42,6 @@ func (sig *e2eIoWrite) OnEvent(event protocol.Event) error { switch eventObj.EventName { case "io_write": - path, err := helpers.GetTraceeStringArgumentByName(eventObj, "path") - if err != nil { - return err - } - - lenArg, err := helpers.GetTraceeArgumentByName(eventObj, "len", helpers.GetArgOps{DefaultArgs: false}) - if err != nil { - return err - } - writeLen, ok := lenArg.Value.(uint32) - if !ok { - return nil - } - - // check expected values from test for detection - - if eventObj.ProcessName != "io_uring_writev" || writeLen != 2 || path != "/tmp/io_uring_writev.txt" { - return nil - } m, _ := sig.GetMetadata() diff --git a/tests/e2e-inst-test.sh b/tests/e2e-inst-test.sh index da1b772f832e..bcbcc4fb33eb 100755 --- a/tests/e2e-inst-test.sh +++ b/tests/e2e-inst-test.sh @@ -137,7 +137,7 @@ for TEST in $TESTS; do --output option:parse-arguments \ --log file:$SCRIPT_TMP_DIR/tracee-log-$$ \ --signatures-dir "$SIG_DIR" \ - --scope comm=echo,mv,ls,tracee,proctreetester,io_uring_writev \ + --scope comm=echo,mv,ls,tracee,proctreetester,io_uring*,io_ring*,iou-* \ --events "$TEST" & # Wait tracee to start