summaryrefslogtreecommitdiffstats
path: root/tests/functional/arbiter
diff options
context:
space:
mode:
authorvamahaja <vamahaja@redhat.com>2019-09-03 18:40:23 +0530
committervamahaja <vamahaja@redhat.com>2019-09-13 17:28:10 +0530
commitc5c02f6402ebe010e8db71eda738857d73f7e83d (patch)
treeec11367a5a2d2282ba9e1fb1b48fe2d56562fba4 /tests/functional/arbiter
parent610c21c8a73329a13167f47bf6de0cf66e57cd05 (diff)
Fix test cases which are failing to delete volume after test completion
In test case when we use large disk size, heketi takes time to create volume and due to timeout it gives error. Add fix in such test cases to check if volume created after getting an exception, get details of such volumes or raise exception in case it fails to create volume. Change-Id: I1c23a8c6558c23edf8947771e4f41a4bd3ffd66a Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'tests/functional/arbiter')
-rw-r--r--tests/functional/arbiter/test_arbiter.py28
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/functional/arbiter/test_arbiter.py b/tests/functional/arbiter/test_arbiter.py
index 6d5ab44..be0ab39 100644
--- a/tests/functional/arbiter/test_arbiter.py
+++ b/tests/functional/arbiter/test_arbiter.py
@@ -515,27 +515,10 @@ class TestArbiterVolumeCreateExpandDelete(baseclass.BaseClass):
self.create_storage_class(is_arbiter_vol=True)
# Create and delete 3 small volumes concurrently
- pvc_names = []
- for i in range(3):
- pvc_name = openshift_ops.oc_create_pvc(
- self.node, self.sc_name, pvc_name_prefix='arbiter-pvc',
- pvc_size=int(pvc_size / 3))
- pvc_names.append(pvc_name)
- exception_exists = False
- for pvc_name in pvc_names:
- try:
- openshift_ops.verify_pvc_status_is_bound(self.node, pvc_name)
- except Exception:
- for pvc_name in pvc_names:
- self.addCleanup(
- openshift_ops.wait_for_resource_absence,
- self.node, 'pvc', pvc_name)
- for pvc_name in pvc_names:
- self.addCleanup(
- openshift_ops.oc_delete, self.node, 'pvc', pvc_name)
- exception_exists = True
- if exception_exists:
- raise
+ pvc_names = self.create_and_wait_for_pvcs(
+ pvc_size=int(pvc_size / 3), pvc_name_prefix='arbiter-pvc',
+ pvc_amount=3, sc_name=self.sc_name)
+
for pvc_name in pvc_names:
openshift_ops.oc_delete(self.node, 'pvc', pvc_name)
for pvc_name in pvc_names:
@@ -547,7 +530,8 @@ class TestArbiterVolumeCreateExpandDelete(baseclass.BaseClass):
self.node, self.sc_name, pvc_name_prefix='arbiter-pvc',
pvc_size=pvc_size)
try:
- openshift_ops.verify_pvc_status_is_bound(self.node, pvc_name)
+ openshift_ops.verify_pvc_status_is_bound(
+ self.node, pvc_name, 300, 10)
except Exception:
self.addCleanup(
openshift_ops.wait_for_resource_absence,