Skip to content

Commit

Permalink
chore(integration): align to data decode types
Browse files Browse the repository at this point in the history
  • Loading branch information
NDStrahilevitz committed Dec 26, 2024
1 parent dd2bb84 commit 4787f8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/integration/capture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Test_TraceeCapture(t *testing.T) {
},
{
name: "capture packet context",
coolDown: 0 * time.Second,
coolDown: 2 * time.Second,
directory: "/tmp/tracee/4",
captureFilters: []string{"network", "pcap:single,command,container,process"},
test: packetContext,
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/event_filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ func Test_EventFilters(t *testing.T) {
expectEvent(anyHost, "fakeprog1", testutils.CPUForTests, anyPID, 0, events.Openat, orPolNames("comm-event-data-64"), orPolIDs(64),
expectArg("dirfd", int32(0)),
expectArg("flags", int32(0)),
expectArg("mode", uint16(0)),
expectArg("mode", uint32(0)),
),
},
[]string{},
Expand All @@ -1615,7 +1615,7 @@ func Test_EventFilters(t *testing.T) {
[]trace.Event{
expectEvent(anyHost, "fakeprog2", testutils.CPUForTests, anyPID, 0, events.Open, orPolNames("comm-event-data-42"), orPolIDs(42),
expectArg("flags", int32(0)),
expectArg("mode", uint16(0)),
expectArg("mode", uint32(0)),
),
},
[]string{},
Expand Down Expand Up @@ -1683,7 +1683,7 @@ func Test_EventFilters(t *testing.T) {
expectEvent(anyHost, "fakeprog1", testutils.CPUForTests, anyPID, 0, events.Openat, orPolNames("comm-event-retval-64"), orPolIDs(64),
expectArg("dirfd", int32(0)),
expectArg("flags", int32(0)),
expectArg("mode", uint16(0)),
expectArg("mode", uint32(0)),
),
},
[]string{},
Expand Down Expand Up @@ -2852,16 +2852,16 @@ func ExpectAllEvtsEqualToOne(t *testing.T, cmdEvents []cmdEvents, actual *eventB
if strings.Contains(v, "*") {
v = strings.ReplaceAll(v, "*", "")
if !strings.Contains(actVal, v) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s, got %s", expEvt, v, actVal)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s (type %T), got %s (type %T)", expEvt, v, v, actVal, actVal)
}
} else {
if !assert.ObjectsAreEqual(v, actVal) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s, got %s", expEvt, v, actVal)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s (type %T), got %s (type %T)", expEvt, v, v, actVal, actVal)
}
}
default:
if !assert.ObjectsAreEqual(v, actArg.Value) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %v, got %v", expEvt, v, actArg.Value)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %v (type %T), got %v (type %T)", expEvt, v, v, actArg.Value, actArg.Value)
}
}
}
Expand Down Expand Up @@ -2960,17 +2960,17 @@ func ExpectAllInOrderSequentially(t *testing.T, cmdEvents []cmdEvents, actual *e
if strings.Contains(v, "*") {
v = strings.ReplaceAll(v, "*", "")
if !strings.Contains(actVal, v) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s, got %s", expEvt, v, actVal)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s (type %T), got %s (type %T)", expEvt, v, v, actVal, actVal)
}
} else {
if !assert.ObjectsAreEqual(v, actArg.Value) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s, got %s", expEvt, v, actVal)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %s (type %T), got %s (type %T)", expEvt, v, v, actVal, actVal)
}
}

default:
if !assert.ObjectsAreEqual(v, actArg.Value) {
return fmt.Errorf("Event %+v:\narg value mismatch: expected %v, got %v", expEvt, v, actArg.Value)
return fmt.Errorf("Event %+v:\narg value mismatch: expected %v (type %T), got %v (type %T)", expEvt, v, v, actArg.Value, actArg.Value)
}
}
}
Expand Down

0 comments on commit 4787f8f

Please sign in to comment.