e2e: add e2e to test clone in different pool

added a e2e to test clones in different
pool.

Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>
Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
Yug 2021-03-22 13:05:15 +05:30 committed by mergify[bot]
parent 1b2e9f556f
commit 8d038db047

View File

@ -1212,6 +1212,52 @@ var _ = Describe("RBD", func() {
} }
}) })
By("create rbd clones in different pool", func() {
// snapshot beta is only supported from v1.17+
if !k8sVersionGreaterEquals(f.ClientSet, 1, 17) {
Skip("pvc restore is only supported from v1.17+")
}
clonePool := "clone-test"
// create pool for clones
err := createPool(f, clonePool)
if err != nil {
e2elog.Failf("failed to create pool %s with error %v", clonePool, err)
}
err = createRBDSnapshotClass(f)
if err != nil {
e2elog.Failf("failed to create snapshotclass with error %v", err)
}
cloneSC := "clone-storageclass"
param := map[string]string{
"pool": clonePool,
}
// create new storageclass with new pool
err = createRBDStorageClass(f.ClientSet, f, cloneSC, nil, param, deletePolicy)
if err != nil {
e2elog.Failf("failed to create storageclass with error %v", err)
}
err = validateCloneInDifferentPool(f, defaultRBDPool, cloneSC, clonePool)
if err != nil {
e2elog.Failf("failed to validate clones in different pool with error %v", err)
}
_, err = framework.RunKubectl(cephCSINamespace, "delete", "sc", cloneSC, "--ignore-not-found=true")
if err != nil {
e2elog.Failf("failed to delete storageclass %s with error %v", cloneSC, err)
}
err = deleteResource(rbdExamplePath + "snapshotclass.yaml")
if err != nil {
e2elog.Failf("failed to delete snapshotclass with error %v", err)
}
err = deletePool(clonePool, false, f)
if err != nil {
e2elog.Failf("failed to delete pool %s with error %v", clonePool, err)
}
})
By("create ROX PVC clone and mount it to multiple pods", func() { By("create ROX PVC clone and mount it to multiple pods", func() {
// snapshot beta is only supported from v1.17+ // snapshot beta is only supported from v1.17+
if k8sVersionGreaterEquals(f.ClientSet, 1, 17) { if k8sVersionGreaterEquals(f.ClientSet, 1, 17) {