diff --git a/.gitignore b/.gitignore index 5190f5cd3..421e2bfa6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ subsystem/logs .project subsystem/data/*.leases* *.log +**/junit_unit_test.xml diff --git a/Dockerfile.assisted_installer_agent-build b/Dockerfile.assisted_installer_agent-build index 616297afd..08f40a0ed 100644 --- a/Dockerfile.assisted_installer_agent-build +++ b/Dockerfile.assisted_installer_agent-build @@ -6,7 +6,7 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i go install golang.org/x/tools/cmd/goimports@v0.1.0 && \ go install github.com/onsi/ginkgo/ginkgo@v1.16.1 && \ go install github.com/golang/mock/mockgen@v1.6.0 && \ - go install github.com/vektra/mockery/v2@v2.9.6 && \ + go install github.com/vektra/mockery/v2@v2.39.2 && \ go install gotest.tools/gotestsum@v1.6.3 && \ go install github.com/axw/gocov/gocov@v1.1.0 && \ go install github.com/AlekSi/gocov-xml@v1.1.0 diff --git a/pkg/journalLogger/mock_IJournalWriter.go b/pkg/journalLogger/mock_IJournalWriter.go index f09061c40..9f2a181db 100644 --- a/pkg/journalLogger/mock_IJournalWriter.go +++ b/pkg/journalLogger/mock_IJournalWriter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package journalLogger @@ -16,6 +16,10 @@ type MockIJournalWriter struct { func (_m *MockIJournalWriter) Send(msg string, p journald.Priority, fields map[string]interface{}) error { ret := _m.Called(msg, p, fields) + if len(ret) == 0 { + panic("no return value specified for Send") + } + var r0 error if rf, ok := ret.Get(0).(func(string, journald.Priority, map[string]interface{}) error); ok { r0 = rf(msg, p, fields) @@ -26,13 +30,12 @@ func (_m *MockIJournalWriter) Send(msg string, p journald.Priority, fields map[s return r0 } -type mockConstructorTestingTNewMockIJournalWriter interface { +// NewMockIJournalWriter creates a new instance of MockIJournalWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockIJournalWriter(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockIJournalWriter creates a new instance of MockIJournalWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockIJournalWriter(t mockConstructorTestingTNewMockIJournalWriter) *MockIJournalWriter { +}) *MockIJournalWriter { mock := &MockIJournalWriter{} mock.Mock.Test(t) diff --git a/src/connectivity_check/connectivity_check_test.go b/src/connectivity_check/connectivity_check_test.go index 1af2e6c5e..fd8e3a68a 100644 --- a/src/connectivity_check/connectivity_check_test.go +++ b/src/connectivity_check/connectivity_check_test.go @@ -218,7 +218,7 @@ var _ = Describe("check host parallel validation", func() { It(t.name, func() { d := setupDispather(t.simulateL2IPConflict, t.success, t.hosts.Nics) ret, err := d.Run(models.ConnectivityCheckParams{t.hosts}, funk.Map(t.nics, func(s string) OutgoingNic { - return OutgoingNic{Name: s, HasIpv4Addresses: true, HasIpv6Addresses: true} + return OutgoingNic{Name: s, HasIpv4Addresses: true, HasIpv6Addresses: true, Addresses: getAddr("192.168.1.133", 24)} }).([]OutgoingNic)) Expect(err).ToNot(HaveOccurred()) Expect(ret.RemoteHosts).To(HaveLen(1)) @@ -346,3 +346,13 @@ func TestConnectivityCheck(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "connectivity check tests") } + +func getAddr(addr string, mask int) []net.Addr { + localIP := net.ParseIP(addr) + localMask := net.CIDRMask(mask, 32) + + return []net.Addr{&net.IPNet{ + IP: localIP, + Mask: localMask, + }} +} diff --git a/src/connectivity_check/ipv4_arping_checker.go b/src/connectivity_check/ipv4_arping_checker.go index 0119cc787..3dffe57f8 100644 --- a/src/connectivity_check/ipv4_arping_checker.go +++ b/src/connectivity_check/ipv4_arping_checker.go @@ -1,10 +1,11 @@ package connectivity_check import ( - "os/exec" + "net" "regexp" "sort" "strings" + "time" "github.com/openshift/assisted-installer-agent/src/util" "github.com/openshift/assisted-service/models" @@ -24,61 +25,81 @@ func (p *arpingChecker) Check(attributes Attributes) ResultReporter { return nil } - result, err := p.executer.Execute("arping", "-c", "10", "-w", "5", "-I", attributes.OutgoingNIC.Name, attributes.RemoteIPAddress) - if err != nil { - // Ignore exit code of 1; only 2 or -1 are actual errors - if exitErr, ok := err.(*exec.ExitError); !ok || exitErr.ExitCode() != 1 { - log.WithError(err).Error("Error while processing 'arping' command") + for _, addr := range attributes.OutgoingNIC.Addresses { + _, nicNetwork, err := net.ParseCIDR(addr.String()) + if err != nil { + log.WithError(err).Errorf("Cannot Parse CIDR: %s", addr.String()) return nil } - } - lines := strings.Split(result, "\n") - if len(lines) == 0 { - log.Warn("Missing output for arping") - return nil - } - hRegex := regexp.MustCompile("^ARPING ([^ ]+) from ([^ ]+) ([^ ]+)$") - parts := hRegex.FindStringSubmatch(lines[0]) - if len(parts) != 4 { - log.Warnf("Wrong format for header line: %s", lines[0]) - return nil - } + remoteIP := net.ParseIP(attributes.RemoteIPAddress) + if !nicNetwork.Contains(remoteIP) { + continue + } - outgoingIpAddress := parts[2] - rRegexp := regexp.MustCompile(`^Unicast reply from ([^ ]+) \[([^]]+)\] [^ ]+$`) + log.Infof("Waiting for host to be available , with IP %s", attributes.RemoteIPAddress) + for i := 0; i < 10; i++ { + _, err = p.executer.Execute("ping", "-c", "2", attributes.RemoteIPAddress) + if err != nil { + time.Sleep(3 * time.Second) + } + } - // We use a map to de-duplicate arping responses from the same mac. They are redundant - // because the reason we're reporting more than one line of arping in the first place is to allow - // the service to also detect devices in the network that have IP conflict with cluster hosts - returnValues := make(map[string]*models.L2Connectivity) - for _, line := range lines[1:] { - parts = rRegexp.FindStringSubmatch(line) - if len(parts) != 3 { - continue + result, err := p.executer.Execute("arping", "-c", "10", "-w", "5", "-I", attributes.OutgoingNIC.Name, attributes.RemoteIPAddress) + if err != nil { + log.WithError(err).Errorf("Error while processing 'arping' command. remote address: %v, Outgioing NIC: %v", attributes.RemoteIPAddress, attributes.OutgoingNIC.Name) + return nil } - remoteMAC := strings.ToLower(parts[2]) - successful := macInDstMacs(remoteMAC, attributes.RemoteMACAddresses) - if !successful { - log.Warnf("Unexpected mac address for arping %s on nic %s: %s", attributes.RemoteIPAddress, attributes.OutgoingNIC.Name, remoteMAC) + lines := strings.Split(result, "\n") + if len(lines) == 0 { + log.Warn("Missing output for arping") + return nil } - if strings.ToLower(attributes.RemoteMACAddress) != remoteMAC { - log.Infof("Received remote mac %s different then expected mac %s", remoteMAC, attributes.RemoteMACAddress) + + hRegex := regexp.MustCompile("^ARPING ([^ ]+) from ([^ ]+) ([^ ]+)$") + parts := hRegex.FindStringSubmatch(lines[0]) + if len(parts) != 4 { + log.Warnf("Wrong format for header line: %s", lines[0]) + return nil } - returnValues[remoteMAC] = &models.L2Connectivity{ - OutgoingIPAddress: outgoingIpAddress, - OutgoingNic: attributes.OutgoingNIC.Name, - RemoteIPAddress: attributes.RemoteIPAddress, - RemoteMac: remoteMAC, - Successful: successful, + outgoingIpAddress := parts[2] + rRegexp := regexp.MustCompile(`^Unicast reply from ([^ ]+) \[([^]]+)\] [^ ]+$`) + + // We use a map to de-duplicate arping responses from the same mac. They are redundant + // because the reason we're reporting more than one line of arping in the first place is to allow + // the service to also detect devices in the network that have IP conflict with cluster hosts + returnValues := make(map[string]*models.L2Connectivity) + for _, line := range lines[1:] { + parts = rRegexp.FindStringSubmatch(line) + if len(parts) != 3 { + continue + } + remoteMAC := strings.ToLower(parts[2]) + successful := macInDstMacs(remoteMAC, attributes.RemoteMACAddresses) + if !successful { + log.Warnf("Unexpected mac address for arping %s on nic %s: %s", attributes.RemoteIPAddress, attributes.OutgoingNIC.Name, remoteMAC) + } + if strings.ToLower(attributes.RemoteMACAddress) != remoteMAC { + log.Infof("Received remote mac %s different then expected mac %s", remoteMAC, attributes.RemoteMACAddress) + } + + returnValues[remoteMAC] = &models.L2Connectivity{ + OutgoingIPAddress: outgoingIpAddress, + OutgoingNic: attributes.OutgoingNIC.Name, + RemoteIPAddress: attributes.RemoteIPAddress, + RemoteMac: remoteMAC, + Successful: successful, + } } + var l2Connectivity []*models.L2Connectivity + for _, v := range returnValues { + l2Connectivity = append(l2Connectivity, v) + } + return newArpingResultReporter(l2Connectivity) } - var l2Connectivity []*models.L2Connectivity - for _, v := range returnValues { - l2Connectivity = append(l2Connectivity, v) - } - return newArpingResultReporter(l2Connectivity) + + return nil } func (p *arpingChecker) Finalize(resultingHost *models.ConnectivityRemoteHost) { diff --git a/src/connectivity_check/ipv4_arping_checker_test.go b/src/connectivity_check/ipv4_arping_checker_test.go index ca8a2f2bb..9b9b878e6 100644 --- a/src/connectivity_check/ipv4_arping_checker_test.go +++ b/src/connectivity_check/ipv4_arping_checker_test.go @@ -55,7 +55,7 @@ Received 0 response(s) attributes := Attributes{ RemoteIPAddress: remoteIPAddress, RemoteMACAddress: remoteMACAddress, - OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true}, + OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true, Addresses: getAddr(outgoingIPAddress, 24)}, RemoteMACAddresses: remoteMACAddresses, } mockFullReply(remoteIPAddress, remoteMACAddress) @@ -84,7 +84,7 @@ Received 0 response(s) attributes := Attributes{ RemoteIPAddress: remoteIPAddress, RemoteMACAddress: remoteMACAddress, - OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true}, + OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true, Addresses: getAddr(outgoingIPAddress, 24)}, RemoteMACAddresses: remoteMACAddresses, } mockFullReply(remoteIPAddress, secondaryMACAddress) @@ -103,7 +103,7 @@ Received 0 response(s) attributes := Attributes{ RemoteIPAddress: remoteIPAddress, RemoteMACAddress: remoteMACAddress, - OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true}, + OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true, Addresses: getAddr(outgoingIPAddress, 24)}, RemoteMACAddresses: remoteMACAddresses, } mockFullReply(remoteIPAddress, additionalMACAddress) @@ -122,7 +122,7 @@ Received 0 response(s) attributes := Attributes{ RemoteIPAddress: remoteIPAddress, RemoteMACAddress: remoteMACAddress, - OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true}, + OutgoingNIC: OutgoingNic{Name: outgoingNIC, HasIpv4Addresses: true, Addresses: getAddr(outgoingIPAddress, 24)}, RemoteMACAddresses: remoteMACAddresses, } mockEmptyReply(remoteIPAddress) diff --git a/src/connectivity_check/mock_Checker.go b/src/connectivity_check/mock_Checker.go index 214615655..449eee717 100644 --- a/src/connectivity_check/mock_Checker.go +++ b/src/connectivity_check/mock_Checker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package connectivity_check @@ -16,6 +16,10 @@ type MockChecker struct { func (_m *MockChecker) Check(attributes Attributes) ResultReporter { ret := _m.Called(attributes) + if len(ret) == 0 { + panic("no return value specified for Check") + } + var r0 ResultReporter if rf, ok := ret.Get(0).(func(Attributes) ResultReporter); ok { r0 = rf(attributes) @@ -32,6 +36,10 @@ func (_m *MockChecker) Check(attributes Attributes) ResultReporter { func (_m *MockChecker) Features() Features { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Features") + } + var r0 Features if rf, ok := ret.Get(0).(func() Features); ok { r0 = rf() @@ -47,13 +55,12 @@ func (_m *MockChecker) Finalize(resultingHost *models.ConnectivityRemoteHost) { _m.Called(resultingHost) } -type mockConstructorTestingTNewMockChecker interface { +// NewMockChecker creates a new instance of MockChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockChecker(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockChecker creates a new instance of MockChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockChecker(t mockConstructorTestingTNewMockChecker) *MockChecker { +}) *MockChecker { mock := &MockChecker{} mock.Mock.Test(t) diff --git a/src/connectivity_check/mock_Executer.go b/src/connectivity_check/mock_Executer.go index f0a304d32..b248d95f2 100644 --- a/src/connectivity_check/mock_Executer.go +++ b/src/connectivity_check/mock_Executer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package connectivity_check @@ -20,14 +20,21 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, error) _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, ...string) (string, error)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, ...string) error); ok { r1 = rf(command, args...) } else { @@ -37,13 +44,12 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, error) return r0, r1 } -type mockConstructorTestingTNewMockExecuter interface { +// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockExecuter(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockExecuter(t mockConstructorTestingTNewMockExecuter) *MockExecuter { +}) *MockExecuter { mock := &MockExecuter{} mock.Mock.Test(t) diff --git a/src/connectivity_check/mock_ResultReporter.go b/src/connectivity_check/mock_ResultReporter.go index 8d72111c9..4df33458c 100644 --- a/src/connectivity_check/mock_ResultReporter.go +++ b/src/connectivity_check/mock_ResultReporter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package connectivity_check @@ -16,6 +16,10 @@ type MockResultReporter struct { func (_m *MockResultReporter) Report(resultingHost *models.ConnectivityRemoteHost) error { ret := _m.Called(resultingHost) + if len(ret) == 0 { + panic("no return value specified for Report") + } + var r0 error if rf, ok := ret.Get(0).(func(*models.ConnectivityRemoteHost) error); ok { r0 = rf(resultingHost) @@ -26,13 +30,12 @@ func (_m *MockResultReporter) Report(resultingHost *models.ConnectivityRemoteHos return r0 } -type mockConstructorTestingTNewMockResultReporter interface { +// NewMockResultReporter creates a new instance of MockResultReporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockResultReporter(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockResultReporter creates a new instance of MockResultReporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockResultReporter(t mockConstructorTestingTNewMockResultReporter) *MockResultReporter { +}) *MockResultReporter { mock := &MockResultReporter{} mock.Mock.Test(t) diff --git a/src/container_image_availability/mock_ImageAvailabilityDependencies.go b/src/container_image_availability/mock_ImageAvailabilityDependencies.go index 875611359..37efd703b 100644 --- a/src/container_image_availability/mock_ImageAvailabilityDependencies.go +++ b/src/container_image_availability/mock_ImageAvailabilityDependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package container_image_availability @@ -20,21 +20,28 @@ func (_m *MockImageAvailabilityDependencies) ExecutePrivileged(command string, a _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecutePrivileged") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -44,13 +51,12 @@ func (_m *MockImageAvailabilityDependencies) ExecutePrivileged(command string, a return r0, r1, r2 } -type mockConstructorTestingTNewMockImageAvailabilityDependencies interface { +// NewMockImageAvailabilityDependencies creates a new instance of MockImageAvailabilityDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockImageAvailabilityDependencies(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockImageAvailabilityDependencies creates a new instance of MockImageAvailabilityDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockImageAvailabilityDependencies(t mockConstructorTestingTNewMockImageAvailabilityDependencies) *MockImageAvailabilityDependencies { +}) *MockImageAvailabilityDependencies { mock := &MockImageAvailabilityDependencies{} mock.Mock.Test(t) diff --git a/src/dhcp_lease_allocate/mock_Dependencies.go b/src/dhcp_lease_allocate/mock_Dependencies.go index 21f545cf1..83fcf01f0 100644 --- a/src/dhcp_lease_allocate/mock_Dependencies.go +++ b/src/dhcp_lease_allocate/mock_Dependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package dhcp_lease_allocate @@ -29,21 +29,28 @@ func (_m *MockDependencies) Execute(command string, args ...string) (string, str _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -57,21 +64,28 @@ func (_m *MockDependencies) Execute(command string, args ...string) (string, str func (_m *MockDependencies) GetLastLeaseFromFile(log logrus.FieldLogger, fileName string) (string, string, error) { ret := _m.Called(log, fileName) + if len(ret) == 0 { + panic("no return value specified for GetLastLeaseFromFile") + } + var r0 string + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(logrus.FieldLogger, string) (string, string, error)); ok { + return rf(log, fileName) + } if rf, ok := ret.Get(0).(func(logrus.FieldLogger, string) string); ok { r0 = rf(log, fileName) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(logrus.FieldLogger, string) string); ok { r1 = rf(log, fileName) } else { r1 = ret.Get(1).(string) } - var r2 error if rf, ok := ret.Get(2).(func(logrus.FieldLogger, string) error); ok { r2 = rf(log, fileName) } else { @@ -85,7 +99,15 @@ func (_m *MockDependencies) GetLastLeaseFromFile(log logrus.FieldLogger, fileNam func (_m *MockDependencies) LeaseInterface(log logrus.FieldLogger, masterDevice string, name string, mac net.HardwareAddr) (*net.Interface, error) { ret := _m.Called(log, masterDevice, name, mac) + if len(ret) == 0 { + panic("no return value specified for LeaseInterface") + } + var r0 *net.Interface + var r1 error + if rf, ok := ret.Get(0).(func(logrus.FieldLogger, string, string, net.HardwareAddr) (*net.Interface, error)); ok { + return rf(log, masterDevice, name, mac) + } if rf, ok := ret.Get(0).(func(logrus.FieldLogger, string, string, net.HardwareAddr) *net.Interface); ok { r0 = rf(log, masterDevice, name, mac) } else { @@ -94,7 +116,6 @@ func (_m *MockDependencies) LeaseInterface(log logrus.FieldLogger, masterDevice } } - var r1 error if rf, ok := ret.Get(1).(func(logrus.FieldLogger, string, string, net.HardwareAddr) error); ok { r1 = rf(log, masterDevice, name, mac) } else { @@ -108,7 +129,15 @@ func (_m *MockDependencies) LeaseInterface(log logrus.FieldLogger, masterDevice func (_m *MockDependencies) LinkByName(name string) (netlink.Link, error) { ret := _m.Called(name) + if len(ret) == 0 { + panic("no return value specified for LinkByName") + } + var r0 netlink.Link + var r1 error + if rf, ok := ret.Get(0).(func(string) (netlink.Link, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) netlink.Link); ok { r0 = rf(name) } else { @@ -117,7 +146,6 @@ func (_m *MockDependencies) LinkByName(name string) (netlink.Link, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -131,6 +159,10 @@ func (_m *MockDependencies) LinkByName(name string) (netlink.Link, error) { func (_m *MockDependencies) LinkDel(link netlink.Link) error { ret := _m.Called(link) + if len(ret) == 0 { + panic("no return value specified for LinkDel") + } + var r0 error if rf, ok := ret.Get(0).(func(netlink.Link) error); ok { r0 = rf(link) @@ -145,6 +177,10 @@ func (_m *MockDependencies) LinkDel(link netlink.Link) error { func (_m *MockDependencies) MkdirAll(path string, perm fs.FileMode) error { ret := _m.Called(path, perm) + if len(ret) == 0 { + panic("no return value specified for MkdirAll") + } + var r0 error if rf, ok := ret.Get(0).(func(string, fs.FileMode) error); ok { r0 = rf(path, perm) @@ -159,7 +195,15 @@ func (_m *MockDependencies) MkdirAll(path string, perm fs.FileMode) error { func (_m *MockDependencies) ReadFile(filename string) ([]byte, error) { ret := _m.Called(filename) + if len(ret) == 0 { + panic("no return value specified for ReadFile") + } + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { + return rf(filename) + } if rf, ok := ret.Get(0).(func(string) []byte); ok { r0 = rf(filename) } else { @@ -168,7 +212,6 @@ func (_m *MockDependencies) ReadFile(filename string) ([]byte, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(filename) } else { @@ -182,6 +225,10 @@ func (_m *MockDependencies) ReadFile(filename string) ([]byte, error) { func (_m *MockDependencies) WriteFile(filename string, data []byte, perm fs.FileMode) error { ret := _m.Called(filename, data, perm) + if len(ret) == 0 { + panic("no return value specified for WriteFile") + } + var r0 error if rf, ok := ret.Get(0).(func(string, []byte, fs.FileMode) error); ok { r0 = rf(filename, data, perm) @@ -192,13 +239,12 @@ func (_m *MockDependencies) WriteFile(filename string, data []byte, perm fs.File return r0 } -type mockConstructorTestingTNewMockDependencies interface { +// NewMockDependencies creates a new instance of MockDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockDependencies(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockDependencies creates a new instance of MockDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockDependencies(t mockConstructorTestingTNewMockDependencies) *MockDependencies { +}) *MockDependencies { mock := &MockDependencies{} mock.Mock.Test(t) diff --git a/src/disk_speed_check/mock_IDependencies.go b/src/disk_speed_check/mock_IDependencies.go index a7b999233..ab669f447 100644 --- a/src/disk_speed_check/mock_IDependencies.go +++ b/src/disk_speed_check/mock_IDependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package disk_speed_check @@ -20,21 +20,28 @@ func (_m *MockIDependencies) Execute(command string, args ...string) (string, st _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -44,13 +51,12 @@ func (_m *MockIDependencies) Execute(command string, args ...string) (string, st return r0, r1, r2 } -type mockConstructorTestingTNewMockIDependencies interface { +// NewMockIDependencies creates a new instance of MockIDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockIDependencies(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockIDependencies creates a new instance of MockIDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockIDependencies(t mockConstructorTestingTNewMockIDependencies) *MockIDependencies { +}) *MockIDependencies { mock := &MockIDependencies{} mock.Mock.Test(t) diff --git a/src/domain_resolution/mock_DomainResolutionDependencies.go b/src/domain_resolution/mock_DomainResolutionDependencies.go index 2a1fab519..2e0d1a74c 100644 --- a/src/domain_resolution/mock_DomainResolutionDependencies.go +++ b/src/domain_resolution/mock_DomainResolutionDependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.1. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package domain_resolution diff --git a/src/free_addresses/mock_Executer.go b/src/free_addresses/mock_Executer.go index f2e7c6395..08f283d08 100644 --- a/src/free_addresses/mock_Executer.go +++ b/src/free_addresses/mock_Executer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package free_addresses @@ -20,21 +20,28 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, string, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -44,13 +51,12 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, string, return r0, r1, r2 } -type mockConstructorTestingTNewMockExecuter interface { +// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockExecuter(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockExecuter(t mockConstructorTestingTNewMockExecuter) *MockExecuter { +}) *MockExecuter { mock := &MockExecuter{} mock.Mock.Test(t) diff --git a/src/inventory/mock_FileInfo.go b/src/inventory/mock_FileInfo.go index c2dd6e349..3705035f7 100644 --- a/src/inventory/mock_FileInfo.go +++ b/src/inventory/mock_FileInfo.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package inventory @@ -18,6 +18,10 @@ type MockFileInfo struct { func (_m *MockFileInfo) IsDir() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IsDir") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -32,6 +36,10 @@ func (_m *MockFileInfo) IsDir() bool { func (_m *MockFileInfo) ModTime() time.Time { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ModTime") + } + var r0 time.Time if rf, ok := ret.Get(0).(func() time.Time); ok { r0 = rf() @@ -46,6 +54,10 @@ func (_m *MockFileInfo) ModTime() time.Time { func (_m *MockFileInfo) Mode() fs.FileMode { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Mode") + } + var r0 fs.FileMode if rf, ok := ret.Get(0).(func() fs.FileMode); ok { r0 = rf() @@ -60,6 +72,10 @@ func (_m *MockFileInfo) Mode() fs.FileMode { func (_m *MockFileInfo) Name() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Name") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -74,6 +90,10 @@ func (_m *MockFileInfo) Name() string { func (_m *MockFileInfo) Size() int64 { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Size") + } + var r0 int64 if rf, ok := ret.Get(0).(func() int64); ok { r0 = rf() @@ -88,6 +108,10 @@ func (_m *MockFileInfo) Size() int64 { func (_m *MockFileInfo) Sys() interface{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Sys") + } + var r0 interface{} if rf, ok := ret.Get(0).(func() interface{}); ok { r0 = rf() @@ -100,13 +124,12 @@ func (_m *MockFileInfo) Sys() interface{} { return r0 } -type mockConstructorTestingTNewMockFileInfo interface { +// NewMockFileInfo creates a new instance of MockFileInfo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockFileInfo(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockFileInfo creates a new instance of MockFileInfo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockFileInfo(t mockConstructorTestingTNewMockFileInfo) *MockFileInfo { +}) *MockFileInfo { mock := &MockFileInfo{} mock.Mock.Test(t) diff --git a/src/logs_sender/mock_LogsSender.go b/src/logs_sender/mock_LogsSender.go index 22a688dd0..bb0cac5df 100644 --- a/src/logs_sender/mock_LogsSender.go +++ b/src/logs_sender/mock_LogsSender.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package logs_sender @@ -16,6 +16,10 @@ type MockLogsSender struct { func (_m *MockLogsSender) CreateFolderIfNotExist(folder string) error { ret := _m.Called(folder) + if len(ret) == 0 { + panic("no return value specified for CreateFolderIfNotExist") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(folder) @@ -37,21 +41,28 @@ func (_m *MockLogsSender) Execute(command string, args ...string) (string, strin _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -72,14 +83,21 @@ func (_m *MockLogsSender) ExecuteOutputToFile(outputFilePath string, command str _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecuteOutputToFile") + } + var r0 string + var r1 int + if rf, ok := ret.Get(0).(func(string, string, ...string) (string, int)); ok { + return rf(outputFilePath, command, args...) + } if rf, ok := ret.Get(0).(func(string, string, ...string) string); ok { r0 = rf(outputFilePath, command, args...) } else { r0 = ret.Get(0).(string) } - var r1 int if rf, ok := ret.Get(1).(func(string, string, ...string) int); ok { r1 = rf(outputFilePath, command, args...) } else { @@ -100,21 +118,28 @@ func (_m *MockLogsSender) ExecutePrivileged(command string, args ...string) (str _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecutePrivileged") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -135,14 +160,21 @@ func (_m *MockLogsSender) ExecutePrivilegedToFile(outputFilePath string, command _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecutePrivilegedToFile") + } + var r0 string + var r1 int + if rf, ok := ret.Get(0).(func(string, string, ...string) (string, int)); ok { + return rf(outputFilePath, command, args...) + } if rf, ok := ret.Get(0).(func(string, string, ...string) string); ok { r0 = rf(outputFilePath, command, args...) } else { r0 = ret.Get(0).(string) } - var r1 int if rf, ok := ret.Get(1).(func(string, string, ...string) int); ok { r1 = rf(outputFilePath, command, args...) } else { @@ -156,6 +188,10 @@ func (_m *MockLogsSender) ExecutePrivilegedToFile(outputFilePath string, command func (_m *MockLogsSender) FileUploader(filePath string) error { ret := _m.Called(filePath) + if len(ret) == 0 { + panic("no return value specified for FileUploader") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(filePath) @@ -170,6 +206,10 @@ func (_m *MockLogsSender) FileUploader(filePath string) error { func (_m *MockLogsSender) GatherErrorLogs(targetDir string) error { ret := _m.Called(targetDir) + if len(ret) == 0 { + panic("no return value specified for GatherErrorLogs") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(targetDir) @@ -184,6 +224,10 @@ func (_m *MockLogsSender) GatherErrorLogs(targetDir string) error { func (_m *MockLogsSender) GatherInstallerLogs(targetDir string) error { ret := _m.Called(targetDir) + if len(ret) == 0 { + panic("no return value specified for GatherInstallerLogs") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(targetDir) @@ -198,6 +242,10 @@ func (_m *MockLogsSender) GatherInstallerLogs(targetDir string) error { func (_m *MockLogsSender) LogProgressReport(progress models.LogsState) error { ret := _m.Called(progress) + if len(ret) == 0 { + panic("no return value specified for LogProgressReport") + } + var r0 error if rf, ok := ret.Get(0).(func(models.LogsState) error); ok { r0 = rf(progress) @@ -208,13 +256,12 @@ func (_m *MockLogsSender) LogProgressReport(progress models.LogsState) error { return r0 } -type mockConstructorTestingTNewMockLogsSender interface { +// NewMockLogsSender creates a new instance of MockLogsSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockLogsSender(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockLogsSender creates a new instance of MockLogsSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockLogsSender(t mockConstructorTestingTNewMockLogsSender) *MockLogsSender { +}) *MockLogsSender { mock := &MockLogsSender{} mock.Mock.Test(t) diff --git a/src/ntp_synchronizer/mock_NtpSynchronizerDependencies.go b/src/ntp_synchronizer/mock_NtpSynchronizerDependencies.go index fc6a18ee8..7cea2fec9 100644 --- a/src/ntp_synchronizer/mock_NtpSynchronizerDependencies.go +++ b/src/ntp_synchronizer/mock_NtpSynchronizerDependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package ntp_synchronizer @@ -20,21 +20,28 @@ func (_m *MockNtpSynchronizerDependencies) ExecutePrivileged(command string, arg _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecutePrivileged") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -48,7 +55,15 @@ func (_m *MockNtpSynchronizerDependencies) ExecutePrivileged(command string, arg func (_m *MockNtpSynchronizerDependencies) LookupAddr(addr string) ([]string, error) { ret := _m.Called(addr) + if len(ret) == 0 { + panic("no return value specified for LookupAddr") + } + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(addr) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(addr) } else { @@ -57,7 +72,6 @@ func (_m *MockNtpSynchronizerDependencies) LookupAddr(addr string) ([]string, er } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(addr) } else { @@ -71,7 +85,15 @@ func (_m *MockNtpSynchronizerDependencies) LookupAddr(addr string) ([]string, er func (_m *MockNtpSynchronizerDependencies) LookupHost(host string) ([]string, error) { ret := _m.Called(host) + if len(ret) == 0 { + panic("no return value specified for LookupHost") + } + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { + return rf(host) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(host) } else { @@ -80,7 +102,6 @@ func (_m *MockNtpSynchronizerDependencies) LookupHost(host string) ([]string, er } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(host) } else { @@ -90,13 +111,12 @@ func (_m *MockNtpSynchronizerDependencies) LookupHost(host string) ([]string, er return r0, r1 } -type mockConstructorTestingTNewMockNtpSynchronizerDependencies interface { +// NewMockNtpSynchronizerDependencies creates a new instance of MockNtpSynchronizerDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockNtpSynchronizerDependencies(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockNtpSynchronizerDependencies creates a new instance of MockNtpSynchronizerDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockNtpSynchronizerDependencies(t mockConstructorTestingTNewMockNtpSynchronizerDependencies) *MockNtpSynchronizerDependencies { +}) *MockNtpSynchronizerDependencies { mock := &MockNtpSynchronizerDependencies{} mock.Mock.Test(t) diff --git a/src/scanners/mock_SerialDiscovery.go b/src/scanners/mock_SerialDiscovery.go index 6f37c661b..af0c53bdf 100644 --- a/src/scanners/mock_SerialDiscovery.go +++ b/src/scanners/mock_SerialDiscovery.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package scanners @@ -26,7 +26,15 @@ func (_m *MockSerialDiscovery) Baseboard(opts ...*option.Option) (*baseboard.Inf _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Baseboard") + } + var r0 *baseboard.Info + var r1 error + if rf, ok := ret.Get(0).(func(...*option.Option) (*baseboard.Info, error)); ok { + return rf(opts...) + } if rf, ok := ret.Get(0).(func(...*option.Option) *baseboard.Info); ok { r0 = rf(opts...) } else { @@ -35,7 +43,6 @@ func (_m *MockSerialDiscovery) Baseboard(opts ...*option.Option) (*baseboard.Inf } } - var r1 error if rf, ok := ret.Get(1).(func(...*option.Option) error); ok { r1 = rf(opts...) } else { @@ -55,7 +62,15 @@ func (_m *MockSerialDiscovery) Product(opts ...*option.Option) (*product.Info, e _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Product") + } + var r0 *product.Info + var r1 error + if rf, ok := ret.Get(0).(func(...*option.Option) (*product.Info, error)); ok { + return rf(opts...) + } if rf, ok := ret.Get(0).(func(...*option.Option) *product.Info); ok { r0 = rf(opts...) } else { @@ -64,7 +79,6 @@ func (_m *MockSerialDiscovery) Product(opts ...*option.Option) (*product.Info, e } } - var r1 error if rf, ok := ret.Get(1).(func(...*option.Option) error); ok { r1 = rf(opts...) } else { @@ -74,13 +88,12 @@ func (_m *MockSerialDiscovery) Product(opts ...*option.Option) (*product.Info, e return r0, r1 } -type mockConstructorTestingTNewMockSerialDiscovery interface { +// NewMockSerialDiscovery creates a new instance of MockSerialDiscovery. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSerialDiscovery(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockSerialDiscovery creates a new instance of MockSerialDiscovery. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockSerialDiscovery(t mockConstructorTestingTNewMockSerialDiscovery) *MockSerialDiscovery { +}) *MockSerialDiscovery { mock := &MockSerialDiscovery{} mock.Mock.Test(t) diff --git a/src/upgrade_agent/mock_Dependencies.go b/src/upgrade_agent/mock_Dependencies.go index 94fd5a85b..84fd84e58 100644 --- a/src/upgrade_agent/mock_Dependencies.go +++ b/src/upgrade_agent/mock_Dependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package upgrade_agent @@ -20,21 +20,28 @@ func (_m *MockDependencies) ExecutePrivileged(command string, args ...string) (s _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ExecutePrivileged") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -44,13 +51,12 @@ func (_m *MockDependencies) ExecutePrivileged(command string, args ...string) (s return r0, r1, r2 } -type mockConstructorTestingTNewMockDependencies interface { +// NewMockDependencies creates a new instance of MockDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockDependencies(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockDependencies creates a new instance of MockDependencies. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockDependencies(t mockConstructorTestingTNewMockDependencies) *MockDependencies { +}) *MockDependencies { mock := &MockDependencies{} mock.Mock.Test(t) diff --git a/src/util/mock_IDependencies.go b/src/util/mock_IDependencies.go index 5fb57edbd..94f92c0fb 100644 --- a/src/util/mock_IDependencies.go +++ b/src/util/mock_IDependencies.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package util diff --git a/src/util/mock_Interface.go b/src/util/mock_Interface.go index 243c3fc1d..4342f0863 100644 --- a/src/util/mock_Interface.go +++ b/src/util/mock_Interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package util diff --git a/src/util/mock_Link.go b/src/util/mock_Link.go index 6b597a131..830b25fb4 100644 --- a/src/util/mock_Link.go +++ b/src/util/mock_Link.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package util diff --git a/src/util/mock_RouteFinder.go b/src/util/mock_RouteFinder.go index 1619aaf96..bfc37a3c2 100644 --- a/src/util/mock_RouteFinder.go +++ b/src/util/mock_RouteFinder.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package util diff --git a/src/vips_verifier/mock_Executer.go b/src/vips_verifier/mock_Executer.go index 7a8ec3e5c..29723c9de 100644 --- a/src/vips_verifier/mock_Executer.go +++ b/src/vips_verifier/mock_Executer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.6. DO NOT EDIT. +// Code generated by mockery v2.39.2. DO NOT EDIT. package vips_verifier @@ -20,21 +20,28 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, string, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 string + var r1 string + var r2 int + if rf, ok := ret.Get(0).(func(string, ...string) (string, string, int)); ok { + return rf(command, args...) + } if rf, ok := ret.Get(0).(func(string, ...string) string); ok { r0 = rf(command, args...) } else { r0 = ret.Get(0).(string) } - var r1 string if rf, ok := ret.Get(1).(func(string, ...string) string); ok { r1 = rf(command, args...) } else { r1 = ret.Get(1).(string) } - var r2 int if rf, ok := ret.Get(2).(func(string, ...string) int); ok { r2 = rf(command, args...) } else { @@ -44,13 +51,12 @@ func (_m *MockExecuter) Execute(command string, args ...string) (string, string, return r0, r1, r2 } -type mockConstructorTestingTNewMockExecuter interface { +// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockExecuter(t interface { mock.TestingT Cleanup(func()) -} - -// NewMockExecuter creates a new instance of MockExecuter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMockExecuter(t mockConstructorTestingTNewMockExecuter) *MockExecuter { +}) *MockExecuter { mock := &MockExecuter{} mock.Mock.Test(t)