e2e: update cephfs ROX test case

updated cephfs ROX test case to create
ROX Clone PVC instead of creating an empty PVC

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-09-10 15:16:53 +05:30 committed by mergify[bot]
parent 860b65c446
commit be3a78afaf

View File

@ -693,7 +693,18 @@ var _ = Describe("cephfs", func() {
} }
pvc.Namespace = f.UniqueName pvc.Namespace = f.UniqueName
pvc.Spec.AccessModes = []v1.PersistentVolumeAccessMode{v1.ReadOnlyMany} err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
if err != nil {
e2elog.Failf("failed to create PVC with error %v", err)
}
pvcClone, err := loadPVC(pvcSmartClonePath)
if err != nil {
e2elog.Failf("failed to load PVC with error %v", err)
}
pvcClone.Namespace = f.UniqueName
pvcClone.Spec.DataSource.Name = pvc.Name
pvcClone.Spec.AccessModes = []v1.PersistentVolumeAccessMode{v1.ReadOnlyMany}
app, err := loadApp(appPath) app, err := loadApp(appPath)
if err != nil { if err != nil {
e2elog.Failf("failed to load application with error %v", err) e2elog.Failf("failed to load application with error %v", err)
@ -704,8 +715,8 @@ var _ = Describe("cephfs", func() {
"app": app.Name, "app": app.Name,
} }
app.Labels = label app.Labels = label
app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvc.Name app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcClone.Name
err = createPVCAndApp("", f, pvc, app, deployTimeout) err = createPVCAndApp("", f, pvcClone, app, deployTimeout)
if err != nil { if err != nil {
e2elog.Failf("failed to create PVC or application with error %v", err) e2elog.Failf("failed to create PVC or application with error %v", err)
} }
@ -721,11 +732,17 @@ var _ = Describe("cephfs", func() {
e2elog.Failf(stdErr) e2elog.Failf(stdErr)
} }
// delete PVC and app // delete cloned ROX pvc and app
err = deletePVCAndApp("", f, pvc, app) err = deletePVCAndApp("", f, pvcClone, app)
if err != nil { if err != nil {
e2elog.Failf("failed to delete PVC or application with error %v", err) e2elog.Failf("failed to delete PVC or application with error %v", err)
} }
// delete parent pvc
err = deletePVCAndValidatePV(f.ClientSet, pvc, deployTimeout)
if err != nil {
e2elog.Failf("failed to delete PVC with error %v", err)
}
}) })
// Make sure this should be last testcase in this file, because // Make sure this should be last testcase in this file, because
// it deletes pool // it deletes pool