Add more tests for volume recovery cases

This commit is contained in:
Hemant Kumar
2022-03-25 12:06:50 -04:00
parent a99466ca86
commit dee48d3c36
5 changed files with 196 additions and 23 deletions

View File

@@ -175,6 +175,7 @@ type FakeVolumePlugin struct {
LastProvisionerOptions VolumeOptions
NewAttacherCallCount int
NewDetacherCallCount int
NodeExpandCallCount int
VolumeLimits map[string]int64
VolumeLimitsError error
LimitKey string
@@ -471,6 +472,7 @@ func (plugin *FakeVolumePlugin) RequiresFSResize() bool {
}
func (plugin *FakeVolumePlugin) NodeExpand(resizeOptions NodeResizeOptions) (bool, error) {
plugin.NodeExpandCallCount++
if resizeOptions.VolumeSpec.Name() == FailWithInUseVolumeName {
return false, volumetypes.NewFailedPreconditionError("volume-in-use")
}