Skip to content

Commit

Permalink
chore: requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: sanskarsharma3110@gmail.com <sanskarsharma3110@gmail.com>
  • Loading branch information
mastersans committed Jul 31, 2024
1 parent 0932a9b commit afadb66
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gadgets/trace_tcpconnect/test/trace_tcpconnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/require"

gadgettesting "github.com/inspektor-gadget/inspektor-gadget/gadgets/testing"
igtesting "github.com/inspektor-gadget/inspektor-gadget/pkg/testing"
"github.com/inspektor-gadget/inspektor-gadget/pkg/testing/containers"
igrunner "github.com/inspektor-gadget/inspektor-gadget/pkg/testing/ig"
"github.com/inspektor-gadget/inspektor-gadget/pkg/testing/match"
"github.com/inspektor-gadget/inspektor-gadget/pkg/testing/utils"
eventtypes "github.com/inspektor-gadget/inspektor-gadget/pkg/types"
"github.com/stretchr/testify/require"
)

type traceTcpconnectEvent struct {
Expand All @@ -43,6 +44,7 @@ type traceTcpconnectEvent struct {
Latency uint64 `json:"latency,omitempty"`
SrcEndpoint utils.L4Endpoint `json:"src"`
DstEndpoint utils.L4Endpoint `json:"dst"`
ErrorRaw uint32 `json:"error_raw"`
}

func TestTraceTcpconnect(t *testing.T) {
Expand Down Expand Up @@ -96,10 +98,11 @@ func TestTraceTcpconnect(t *testing.T) {
Port: utils.NormalizedInt,
Proto: 6,
},
Comm: "curl",
Uid: 0,
Gid: 0,
Comm: "curl",
ErrorRaw: 0,

Uid: utils.NormalizedInt,
Gid: utils.NormalizedInt,
MntNsID: utils.NormalizedInt,
Timestamp: utils.NormalizedStr,
Pid: utils.NormalizedInt,
Expand All @@ -119,7 +122,7 @@ func TestTraceTcpconnect(t *testing.T) {
match.MatchEntries(t, match.JSONMultiObjectMode, output, normalize, expectedEntries)
},
))
traceTcpconnectCmd := igrunner.New("trace tcpconnect", runnerOpts...)
traceTcpconnectCmd := igrunner.New("trace_tcpconnect", runnerOpts...)
steps := []igtesting.TestStep{
traceTcpconnectCmd,
}
Expand Down

0 comments on commit afadb66

Please sign in to comment.