summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorApeksha D Khakharia <akhakhar@redhat.com>2018-10-04 12:18:39 +0530
committerApeksha D Khakharia <akhakhar@redhat.com>2018-10-25 16:58:31 +0530
commit2840c689e40052f762127e8a928c9ed25fd0808b (patch)
tree88202dc93f437e278ad9fb5ac61d279570af928c /tests
parent4f564564dfdeb754e909e49c9947e33d58895fb1 (diff)
CNS: CNS-438 DynamicProvisioning_GlusterFile_heketiDown_PVC_Delete
Change-Id: I08da2de80d77c1c3f4ab66d2d983a6730d900bfb Signed-off-by: Apeksha D Khakharia <akhakhar@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py42
1 files changed, 41 insertions, 1 deletions
diff --git a/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py b/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py
index f4766f88..54eaea07 100644
--- a/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py
+++ b/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py
@@ -70,7 +70,8 @@ class TestDynamicProvisioningP0(CnsBaseClass):
self.addCleanup(
wait_for_resource_absence, self.node, 'pvc', pvc_name)
for pvc_name in pvc_names:
- self.addCleanup(oc_delete, self.node, 'pvc', pvc_name)
+ self.addCleanup(oc_delete, self.node, 'pvc', pvc_name,
+ raise_on_absence=False)
# Wait for PVCs to be in bound state
for pvc_name in pvc_names:
@@ -320,3 +321,42 @@ class TestDynamicProvisioningP0(CnsBaseClass):
ret, out, err = oc_rsh(node, pod_name, cmd)
self.assertEqual(
ret, 0, "Failed to execute command %s on %s" % (cmd, node))
+
+ def test_dynamic_provisioning_glusterfile_heketidown_pvc_delete(self):
+ """ Delete PVC's when heketi is down CNS-438 """
+
+ # Create storage class and secret objects
+ self._create_storage_class()
+
+ self.pvc_name_list = self._create_and_wait_for_pvcs(
+ 1, 'pvc-heketi-down', 3)
+
+ # remove heketi-pod
+ scale_dc_pod_amount_and_wait(self.ocp_client[0],
+ self.heketi_dc_name,
+ 0,
+ self.cns_project_name)
+ try:
+ # delete pvc
+ for pvc in self.pvc_name_list:
+ oc_delete(self.ocp_client[0], 'pvc', pvc)
+ for pvc in self.pvc_name_list:
+ with self.assertRaises(ExecutionError):
+ wait_for_resource_absence(
+ self.ocp_client[0], 'pvc', pvc,
+ interval=3, timeout=30)
+ finally:
+ # bring back heketi-pod
+ scale_dc_pod_amount_and_wait(self.ocp_client[0],
+ self.heketi_dc_name,
+ 1,
+ self.cns_project_name)
+
+ # verify PVC's are deleted
+ for pvc in self.pvc_name_list:
+ wait_for_resource_absence(self.ocp_client[0], 'pvc',
+ pvc,
+ interval=1, timeout=120)
+
+ # create a new PVC
+ self._create_and_wait_for_pvc()