Skip to content

Commit

Permalink
e2e: remove 1.16 based test enablement in rbd
Browse files Browse the repository at this point in the history
considering we are far out of this release and only care about
kubernetes releases from v1.19, there is no need to have this
version check in place for the tests.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
  • Loading branch information
humblec committed Nov 3, 2021
1 parent c7f090f commit 32b4c1e
Showing 1 changed file with 28 additions and 62 deletions.
90 changes: 28 additions & 62 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,26 +1109,19 @@ var _ = Describe("RBD", func() {
})

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(
defaultCloneCount,
pvcPath,
appPath,
pvcSmartClonePath,
appSmartClonePath,
noKMS,
noPVCValidation,
f)
}
validatePVCClone(
defaultCloneCount,
pvcPath,
appPath,
pvcSmartClonePath,
appSmartClonePath,
noKMS,
noPVCValidation,
f)

})

By("create a thick-provisioned PVC-PVC clone and bind it to an app", func() {
// pvc clone is only supported from v1.16+
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}

err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
e2elog.Failf("failed to delete storageclass with error %v", err)
Expand All @@ -1153,10 +1146,6 @@ var _ = Describe("RBD", func() {
})

By("create an encrypted PVC snapshot and restore it for an app with VaultKMS", func() {
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}

err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
e2elog.Failf("failed to delete storageclass with error %v", err)
Expand Down Expand Up @@ -1187,9 +1176,6 @@ var _ = Describe("RBD", func() {
})

By("Validate PVC restore from vaultKMS to vaultTenantSAKMS", func() {
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}
restoreSCName := "restore-sc"
err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
Expand Down Expand Up @@ -1244,9 +1230,6 @@ var _ = Describe("RBD", func() {
})

By("Validate thick PVC restore from vaultKMS to userSecretsMetadataKMS", func() {
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}
restoreSCName := "restore-sc"
err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
Expand Down Expand Up @@ -1316,10 +1299,6 @@ var _ = Describe("RBD", func() {
})

By("create an encrypted PVC-PVC clone and bind it to an app", func() {
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}

err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
e2elog.Failf("failed to delete storageclass with error %v", err)
Expand All @@ -1346,10 +1325,6 @@ var _ = Describe("RBD", func() {
})

By("create an encrypted PVC-PVC clone and bind it to an app with VaultKMS", func() {
if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
Skip("pvc clone is only supported from v1.16+")
}

err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
e2elog.Failf("failed to delete storageclass with error %v", err)
Expand Down Expand Up @@ -1382,22 +1357,19 @@ var _ = Describe("RBD", func() {
}
})
By("create a Block mode PVC-PVC clone and bind it to an app", func() {
v, err := f.ClientSet.Discovery().ServerVersion()
_, 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(
defaultCloneCount,
rawPvcPath,
rawAppPath,
pvcBlockSmartClonePath,
appBlockSmartClonePath,
noKMS,
noPVCValidation,
f)
}
validatePVCClone(
defaultCloneCount,
rawPvcPath,
rawAppPath,
pvcBlockSmartClonePath,
appBlockSmartClonePath,
noKMS,
noPVCValidation,
f)
})
By("create/delete multiple PVCs and Apps", func() {
totalCount := 2
Expand Down Expand Up @@ -1478,15 +1450,12 @@ var _ = Describe("RBD", func() {
})

By("Resize Block PVC and check Device size", func() {
// Block PVC resize is supported in kubernetes 1.16+
if k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
err := resizePVCAndValidateSize(rawPvcPath, rawAppPath, f)
if err != nil {
e2elog.Failf("failed to resize block PVC with error %v", err)
}
// validate created backend rbd images
validateRBDImageCount(f, 0, defaultRBDPool)
err := resizePVCAndValidateSize(rawPvcPath, rawAppPath, f)
if err != nil {
e2elog.Failf("failed to resize block PVC with error %v", err)
}
// validate created backend rbd images
validateRBDImageCount(f, 0, defaultRBDPool)
})

By("Test unmount after nodeplugin restart", func() {
Expand Down Expand Up @@ -2478,12 +2447,9 @@ var _ = Describe("RBD", func() {
}

// Resize Block PVC and check Device size within the namespace
// Block PVC resize is supported in kubernetes 1.16+
if k8sVersionGreaterEquals(f.ClientSet, 1, 16) {
err = resizePVCAndValidateSize(rawPvcPath, rawAppPath, f)
if err != nil {
e2elog.Failf("failed to resize block PVC with error %v", err)
}
err = resizePVCAndValidateSize(rawPvcPath, rawAppPath, f)
if err != nil {
e2elog.Failf("failed to resize block PVC with error %v", err)
}

// Resize Filesystem PVC and check application directory size
Expand Down

0 comments on commit 32b4c1e

Please sign in to comment.