From 04520dbc2efe56b0d7dae793a4fde9e41a3f6415 Mon Sep 17 00:00:00 2001 From: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:26:32 -0700 Subject: [PATCH] Mocks for new API (#84) --- go.mod | 3 +++ go.sum | 3 +++ pkg/elfparser/mocks/elfparser_mocks.go | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/go.mod b/go.mod index cc9fa8a..fb60076 100644 --- a/go.mod +++ b/go.mod @@ -16,5 +16,8 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect go.uber.org/multierr v1.10.0 // indirect + golang.org/x/mod v0.4.2 // indirect + golang.org/x/tools v0.1.1 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ec7040a..534eec3 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,7 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -37,9 +38,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/elfparser/mocks/elfparser_mocks.go b/pkg/elfparser/mocks/elfparser_mocks.go index 9172a74..138c119 100644 --- a/pkg/elfparser/mocks/elfparser_mocks.go +++ b/pkg/elfparser/mocks/elfparser_mocks.go @@ -80,6 +80,22 @@ func (mr *MockBpfSDKClientMockRecorder) LoadBpfFile(arg0, arg1 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadBpfFile", reflect.TypeOf((*MockBpfSDKClient)(nil).LoadBpfFile), arg0, arg1) } +// LoadBpfFileWithCustomData mocks base method. +func (m *MockBpfSDKClient) LoadBpfFileWithCustomData(arg0 elfparser.BpfCustomData) (map[string]elfparser.BpfData, map[string]maps.BpfMap, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LoadBpfFileWithCustomData", arg0) + ret0, _ := ret[0].(map[string]elfparser.BpfData) + ret1, _ := ret[1].(map[string]maps.BpfMap) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LoadBpfFileWithCustomData indicates an expected call of LoadBpfFileWithCustomData. +func (mr *MockBpfSDKClientMockRecorder) LoadBpfFileWithCustomData(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadBpfFileWithCustomData", reflect.TypeOf((*MockBpfSDKClient)(nil).LoadBpfFileWithCustomData), arg0) +} + // RecoverAllBpfProgramsAndMaps mocks base method. func (m *MockBpfSDKClient) RecoverAllBpfProgramsAndMaps() (map[string]elfparser.BpfData, error) { m.ctrl.T.Helper()