From f0816421dfea5f853bb177188dbaa45f0b1c6a7c Mon Sep 17 00:00:00 2001 From: Adarsh Kumar Yadav <109620911+adarsh-dell@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:41:29 +0530 Subject: [PATCH 1/2] Update mockhelper.go As there are some methods that are calling the cli with diff diff args so mock should handle it for any args type. --- internal/mockhelper/mockhelper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/mockhelper/mockhelper.go b/internal/mockhelper/mockhelper.go index 0166df6..71521b2 100644 --- a/internal/mockhelper/mockhelper.go +++ b/internal/mockhelper/mockhelper.go @@ -195,8 +195,7 @@ func (mh *MockHelper) FilePathGlobOK(m *wrp.MockLimitedFilepath) *gomock.Call { // OSExecCommandContextCall mocks implementation of CommandContext method from LimitedOSExec interface func (mh *MockHelper) OSExecCommandContextCall(m *wrp.MockLimitedOSExec) *gomock.Call { - return m.EXPECT().CommandContext(gomock.Any(), - mh.OSEXECCommandContextName, mh.OSEXECCommandContextArgs) + return m.EXPECT().CommandContext(gomock.Any(), gomock.Any(), gomock.Any()) } // OSExecCommandContextOK mocks returning success from OSExecCommandContextCall From 6aef87378ade4a55da0bf429e9e70ae2bc2b5e7a Mon Sep 17 00:00:00 2001 From: Adarsh Kumar Yadav <109620911+adarsh-dell@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:43:30 +0530 Subject: [PATCH 2/2] Update powerpath_test.go --- pkg/powerpath/powerpath_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/powerpath/powerpath_test.go b/pkg/powerpath/powerpath_test.go index 7016f79..12c7259 100644 --- a/pkg/powerpath/powerpath_test.go +++ b/pkg/powerpath/powerpath_test.go @@ -203,6 +203,8 @@ busy: False stateSetter: func(fields ppFields) { _, cmdMock := mocks.OSExecCommandContextOK(fields.osexec) mocks.OSExecCmdOK(cmdMock) + _, cmdMock2 := mocks.OSExecCommandContextOK(fields.osexec) + mocks.OSExecCmdOK(cmdMock2) }, args: defaultArgs, want: true,