Add code for testing final errors
This commit is contained in:
@@ -88,7 +88,8 @@ const (
|
||||
|
||||
FailVolumeExpansion = "fail-expansion-test"
|
||||
|
||||
AlwaysFailNodeExpansion = "always-fail-node-expansion"
|
||||
InfeasibleNodeExpansion = "infeasible-fail-node-expansion"
|
||||
OtherFinalNodeExpansionError = "other-final-node-expansion-error"
|
||||
|
||||
deviceNotMounted = "deviceNotMounted"
|
||||
deviceMountUncertain = "deviceMountUncertain"
|
||||
@@ -500,8 +501,12 @@ func (plugin *FakeVolumePlugin) NodeExpand(resizeOptions volume.NodeResizeOption
|
||||
return false, volumetypes.NewOperationNotSupportedError("volume-unsupported")
|
||||
}
|
||||
|
||||
if resizeOptions.VolumeSpec.Name() == AlwaysFailNodeExpansion {
|
||||
return false, fmt.Errorf("test failure: NodeExpand")
|
||||
if resizeOptions.VolumeSpec.Name() == InfeasibleNodeExpansion {
|
||||
return false, volumetypes.NewInfeasibleError("infeasible-expansion")
|
||||
}
|
||||
|
||||
if resizeOptions.VolumeSpec.Name() == OtherFinalNodeExpansionError {
|
||||
return false, fmt.Errorf("other-final-node-expansion-error")
|
||||
}
|
||||
|
||||
if resizeOptions.VolumeSpec.Name() == FailVolumeExpansion {
|
||||
|
Reference in New Issue
Block a user