VolumeDevices validation and tests
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
This commit is contained in:
@@ -4974,10 +4974,6 @@ func TestAlphaValidateVolumeDevices(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
disabledAlphaVolDevice := []core.VolumeDevice{
|
||||
{Name: "abc", DevicePath: "/foo"},
|
||||
}
|
||||
|
||||
successCase := []core.VolumeDevice{
|
||||
{Name: "abc", DevicePath: "/foo"},
|
||||
{Name: "abc-123", DevicePath: "/usr/share/test"},
|
||||
@@ -5005,8 +5001,6 @@ func TestAlphaValidateVolumeDevices(t *testing.T) {
|
||||
{Name: "abc-123", MountPath: "/this/path/exists"},
|
||||
}
|
||||
|
||||
// enable BlockVolume
|
||||
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.BlockVolume, true)()
|
||||
// Success Cases:
|
||||
// Validate normal success cases - only PVC volumeSource
|
||||
if errs := ValidateVolumeDevices(successCase, GetVolumeMountMap(goodVolumeMounts), vols, field.NewPath("field")); len(errs) != 0 {
|
||||
@@ -5020,12 +5014,6 @@ func TestAlphaValidateVolumeDevices(t *testing.T) {
|
||||
t.Errorf("expected failure for %s", k)
|
||||
}
|
||||
}
|
||||
|
||||
// disable BlockVolume
|
||||
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.BlockVolume, false)()
|
||||
if errs := ValidateVolumeDevices(disabledAlphaVolDevice, GetVolumeMountMap(goodVolumeMounts), vols, field.NewPath("field")); len(errs) == 0 {
|
||||
t.Errorf("expected failure: %v", errs)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateProbe(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user