From 0bd1d44dc07bc9ec3762a3f966dd501b4e382262 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 6 Jan 2022 20:50:01 +0530 Subject: [PATCH] e2e: add rwop validation for cephfs volumes This commit adds the rwop validation tests for cephfs. Signed-off-by: Humble Chirammal --- e2e/cephfs.go | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 147d74d2f..b1ce48f5d 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -290,13 +290,14 @@ var _ = Describe("cephfs", func() { It("Test CephFS CSI", func() { pvcPath := cephFSExamplePath + "pvc.yaml" appPath := cephFSExamplePath + "pod.yaml" + appRWOPPath := cephFSExamplePath + "pod-rwop.yaml" pvcClonePath := cephFSExamplePath + "pvc-restore.yaml" pvcSmartClonePath := cephFSExamplePath + "pvc-clone.yaml" appClonePath := cephFSExamplePath + "pod-restore.yaml" appSmartClonePath := cephFSExamplePath + "pod-clone.yaml" snapshotPath := cephFSExamplePath + "snapshot.yaml" appEphemeralPath := cephFSExamplePath + "pod-ephemeral.yaml" - + pvcRWOPPath := cephFSExamplePath + "pvc-rwop.yaml" By("checking provisioner deployment is running", func() { err := waitForDeploymentComplete(f.ClientSet, cephFSDeploymentName, cephCSINamespace, deployTimeout) if err != nil { @@ -360,6 +361,48 @@ var _ = Describe("cephfs", func() { } }) + By("verify RWOP volume support", func() { + if k8sVersionGreaterEquals(f.ClientSet, 1, 22) { + err := createCephfsStorageClass(f.ClientSet, f, true, nil) + if err != nil { + e2elog.Failf("failed to create CephFS storageclass: %v", err) + } + pvc, err := loadPVC(pvcRWOPPath) + if err != nil { + e2elog.Failf("failed to load PVC: %v", err) + } + pvc.Namespace = f.UniqueName + + // create application + app, err := loadApp(appRWOPPath) + if err != nil { + e2elog.Failf("failed to load application: %v", err) + } + app.Namespace = f.UniqueName + baseAppName := app.Name + + err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) + if err != nil { + e2elog.Failf("failed to create PVC: %v", err) + } + err = createApp(f.ClientSet, app, deployTimeout) + if err != nil { + e2elog.Failf("failed to create application: %v", err) + } + validateSubvolumeCount(f, 1, fileSystemName, subvolumegroup) + + err = validateRWOPPodCreation(f, pvc, app, baseAppName) + if err != nil { + e2elog.Failf("failed to validate RWOP pod creation: %v", err) + } + validateSubvolumeCount(f, 0, fileSystemName, subvolumegroup) + err = deleteResource(cephFSExamplePath + "storageclass.yaml") + if err != nil { + e2elog.Failf("failed to delete CephFS storageclass: %v", err) + } + } + }) + By("check static PVC", func() { scPath := cephFSExamplePath + "secret.yaml" err := validateCephFsStaticPV(f, appPath, scPath)