Skip to content

Commit

Permalink
fixup! feat(tests): add io_uring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roikol committed Nov 5, 2023
1 parent 094e0fb commit 4b74e80
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
16 changes: 0 additions & 16 deletions tests/e2e-inst-signatures/e2e-io_uring_submit_req.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand Down
20 changes: 0 additions & 20 deletions tests/e2e-inst-signatures/e2e-io_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-inst-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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* \
--events "$TEST" &

# Wait tracee to start
Expand Down

0 comments on commit 4b74e80

Please sign in to comment.