e2e: add e2e for static PVC without imageFeature parameter

This commit adds e2e to make sure static PVC without imageFeatures
parameter fail with proper error event.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2021-06-15 15:38:51 +05:30
committed by mergify[bot]
parent 7fc553a3a7
commit 82a204bfd3
8 changed files with 48 additions and 11 deletions

View File

@ -77,7 +77,7 @@ func getStaticPVC(name, pvName, size, ns, sc string, blockPVC bool) *v1.Persiste
return pvc
}
func validateRBDStaticPV(f *framework.Framework, appPath string, isBlock bool) error {
func validateRBDStaticPV(f *framework.Framework, appPath string, isBlock, checkImgFeat bool) error {
opt := make(map[string]string)
var (
rbdImageName = "test-static-pv"
@ -112,7 +112,9 @@ func validateRBDStaticPV(f *framework.Framework, appPath string, isBlock bool) e
return fmt.Errorf("failed to create rbd image %s", e)
}
opt["clusterID"] = fsID
opt["imageFeatures"] = "layering"
if !checkImgFeat {
opt["imageFeatures"] = "layering"
}
opt["pool"] = defaultRBDPool
opt["staticVolume"] = "true"
if radosNamespace != "" {
@ -140,7 +142,11 @@ func validateRBDStaticPV(f *framework.Framework, appPath string, isBlock bool) e
app.Namespace = namespace
app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcName
err = createApp(f.ClientSet, app, deployTimeout)
if checkImgFeat {
err = createAppErr(f.ClientSet, app, deployTimeout, "missing required parameter imageFeatures")
} else {
err = createApp(f.ClientSet, app, deployTimeout)
}
if err != nil {
return err
}