From 35d58a7d5ace67b00715984c3845cd9759a56f4d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 9 Apr 2021 10:58:59 +0200 Subject: [PATCH] e2e: only test a single encrypted clone/snapshot The default number for cloning and snapshot/restore is 10 volumes. This adds to the time the test suite runs. There is no need to validate 10 copies of the encrypted volume, a single copy is sufficient. Signed-off-by: Niels de Vos --- e2e/rbd.go | 11 ++++++----- e2e/utils.go | 6 ++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/e2e/rbd.go b/e2e/rbd.go index c41a6ac64..3528bb685 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -281,6 +281,7 @@ var _ = Describe("RBD", func() { appSmartClonePath := rbdExamplePath + "pod-clone.yaml" appBlockSmartClonePath := rbdExamplePath + "block-pod-clone.yaml" snapshotPath := rbdExamplePath + "snapshot.yaml" + defaultCloneCount := 10 By("checking provisioner deployment is running", func() { err := waitForDeploymentComplete(rbdDeploymentName, cephCSINamespace, f.ClientSet, deployTimeout) @@ -496,14 +497,14 @@ var _ = Describe("RBD", func() { By("create a PVC clone and bind it to an app", func() { // snapshot beta is only supported from v1.17+ if k8sVersionGreaterEquals(f.ClientSet, 1, 17) { - validatePVCSnapshot(pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, false, f) + validatePVCSnapshot(defaultCloneCount, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, false, f) } }) By("create a PVC-PVC clone and bind it to an app", func() { // pvc clone is only supported from v1.16+ if k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - validatePVCClone(pvcPath, appPath, pvcSmartClonePath, appSmartClonePath, false, f) + validatePVCClone(defaultCloneCount, pvcPath, appPath, pvcSmartClonePath, appSmartClonePath, false, f) } }) @@ -525,7 +526,7 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to create storageclass with error %v", err) } - validatePVCSnapshot(pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, true, f) + validatePVCSnapshot(1, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, true, f) err = deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { @@ -555,7 +556,7 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to create storageclass with error %v", err) } - validatePVCClone(pvcPath, appPath, pvcSmartClonePath, appSmartClonePath, true, f) + validatePVCClone(1, pvcPath, appPath, pvcSmartClonePath, appSmartClonePath, true, f) err = deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { @@ -580,7 +581,7 @@ var _ = Describe("RBD", func() { } // pvc clone is only supported from v1.16+ if v.Major > "1" || (v.Major == "1" && v.Minor >= "16") { - validatePVCClone(rawPvcPath, rawAppPath, pvcBlockSmartClonePath, appBlockSmartClonePath, false, f) + validatePVCClone(defaultCloneCount, rawPvcPath, rawAppPath, pvcBlockSmartClonePath, appBlockSmartClonePath, false, f) } }) By("create/delete multiple PVCs and Apps", func() { diff --git a/e2e/utils.go b/e2e/utils.go index f1b7bc2ab..f6145fdfd 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -506,9 +506,8 @@ func writeDataAndCalChecksum(app *v1.Pod, opt *metav1.ListOptions, f *framework. } // nolint:gocyclo,gocognit // reduce complexity -func validatePVCClone(sourcePvcPath, sourceAppPath, clonePvcPath, clonePvcAppPath string, validateEncryption bool, f *framework.Framework) { +func validatePVCClone(totalCount int, sourcePvcPath, sourceAppPath, clonePvcPath, clonePvcAppPath string, validateEncryption bool, f *framework.Framework) { var wg sync.WaitGroup - totalCount := 10 wgErrs := make([]error, totalCount) chErrs := make([]error, totalCount) pvc, err := loadPVC(sourcePvcPath) @@ -653,9 +652,8 @@ func validatePVCClone(sourcePvcPath, sourceAppPath, clonePvcPath, clonePvcAppPat } // nolint:gocyclo,gocognit // reduce complexity -func validatePVCSnapshot(pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath string, validateEncryption bool, f *framework.Framework) { +func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath string, validateEncryption bool, f *framework.Framework) { var wg sync.WaitGroup - totalCount := 10 wgErrs := make([]error, totalCount) chErrs := make([]error, totalCount) wg.Add(totalCount)