From be3a78afaf97514cf3c1207c4c514a746add03ab Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 10 Sep 2020 15:16:53 +0530 Subject: [PATCH] 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 --- e2e/cephfs.go | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index c152c487d..25fed3b26 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -693,7 +693,18 @@ var _ = Describe("cephfs", func() { } 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) if err != nil { e2elog.Failf("failed to load application with error %v", err) @@ -704,8 +715,8 @@ var _ = Describe("cephfs", func() { "app": app.Name, } app.Labels = label - app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvc.Name - err = createPVCAndApp("", f, pvc, app, deployTimeout) + app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcClone.Name + err = createPVCAndApp("", f, pvcClone, app, deployTimeout) if err != nil { e2elog.Failf("failed to create PVC or application with error %v", err) } @@ -721,11 +732,17 @@ var _ = Describe("cephfs", func() { e2elog.Failf(stdErr) } - // delete PVC and app - err = deletePVCAndApp("", f, pvc, app) + // delete cloned ROX pvc and app + err = deletePVCAndApp("", f, pvcClone, app) if err != nil { 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 // it deletes pool