From 25400a7334149b0457c908df6b7e6d8c6eb99135 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 15 Oct 2020 19:24:57 +0530 Subject: [PATCH] e2e: Introduce e2e test for block mode PVC Signed-off-by: Humble Chirammal --- e2e/rbd.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/e2e/rbd.go b/e2e/rbd.go index 5658942fd..bb360fc5c 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -239,8 +239,10 @@ var _ = Describe("RBD", func() { rawAppPath := rbdExamplePath + "raw-block-pod.yaml" pvcClonePath := rbdExamplePath + "pvc-restore.yaml" pvcSmartClonePath := rbdExamplePath + "pvc-clone.yaml" + pvcBlockSmartClonePath := rbdExamplePath + "pvc-block-clone.yaml" appClonePath := rbdExamplePath + "pod-restore.yaml" appSmartClonePath := rbdExamplePath + "pod-clone.yaml" + appBlockSmartClonePath := rbdExamplePath + "block-pod-clone.yaml" snapshotPath := rbdExamplePath + "snapshot.yaml" By("checking provisioner deployment is running", func() { @@ -590,7 +592,16 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to validate pvc and application binding with error %v", err) } }) - + By("create a Block mode PVC-PVC clone and bind it to an app", func() { + v, err := f.ClientSet.Discovery().ServerVersion() + if err != nil { + e2elog.Failf("failed to get server version with error %v", err) + } + // pvc clone is only supported from v1.16+ + if v.Major > "1" || (v.Major == "1" && v.Minor >= "16") { + validatePVCClone(rawPvcPath, pvcBlockSmartClonePath, appBlockSmartClonePath, f) + } + }) By("create/delete multiple PVCs and Apps", func() { totalCount := 2 pvc, err := loadPVC(pvcPath)