diff --git a/pkg/csi/cinder/controllerserver_test.go b/pkg/csi/cinder/controllerserver_test.go index eb32140a4c..7c36508447 100644 --- a/pkg/csi/cinder/controllerserver_test.go +++ b/pkg/csi/cinder/controllerserver_test.go @@ -49,6 +49,7 @@ func TestCreateVolume(t *testing.T) { osmock.On("CreateVolume", FakeVolName, mock.AnythingOfType("int"), FakeVolType, FakeAvailability, "", "", &properties).Return(&FakeVol, nil) osmock.On("GetVolumesByName", FakeVolName).Return(FakeVolListEmpty, nil) + osmock.On("WaitVolumeTargetStatusWithCustomBackoff", mock.Anything, mock.Anything, mock.Anything).Return(nil) // Init assert assert := assert.New(t) diff --git a/pkg/csi/cinder/openstack/openstack_mock.go b/pkg/csi/cinder/openstack/openstack_mock.go index 5c52cf0fbf..ef5dae489c 100644 --- a/pkg/csi/cinder/openstack/openstack_mock.go +++ b/pkg/csi/cinder/openstack/openstack_mock.go @@ -21,6 +21,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" "github.com/stretchr/testify/mock" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/cloud-provider-openstack/pkg/util/metadata" ) @@ -174,6 +175,20 @@ func (_m *OpenStackMock) WaitVolumeTargetStatus(volumeID string, tStatus []strin return r0 } +// WaitVolumeTargetStatusWithCustomBackoff provides a mock function with given fields: volumeID, tStatus, backoff +func (_m *OpenStackMock) WaitVolumeTargetStatusWithCustomBackoff(volumeID string, tStatus []string, backoff *wait.Backoff) error { + ret := _m.Called(volumeID, tStatus, backoff) + + var r0 error + if rf, ok := ret.Get(0).(func(string, []string, *wait.Backoff) error); ok { + r0 = rf(volumeID, tStatus, backoff) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // WaitDiskDetached provides a mock function with given fields: instanceID, volumeID func (_m *OpenStackMock) WaitDiskDetached(instanceID string, volumeID string) error { ret := _m.Called(instanceID, volumeID)