summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-07-07 17:16:46 +0530
committerVaibhav Mahajan <vamahaja@redhat.com>2020-07-08 04:52:41 +0000
commit057b772753c31450b4de3c0607d3df62af0e6233 (patch)
treeb6328d70f277ef13602d5fa2151f3791df7896d8
parent62e9aa1e9ea6df67ceb08985748666d94ba98118 (diff)
[TestFix] Fix to add wait after the pod creation
Fix consists of - Addition of wait for the pods to be ready after the creation of dc, inside the method '_create_dcs_and_check_brick_placement' which led to the failure of few heketi zone TC's. Change-Id: Ib932e1a338b52673418d39fcd35a9d27f508a48f Signed-off-by: Arun Kumar <aanand01762@gmail.com>
-rw-r--r--tests/functional/heketi/test_heketi_zones.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/functional/heketi/test_heketi_zones.py b/tests/functional/heketi/test_heketi_zones.py
index 10646ae..a5e6fd3 100644
--- a/tests/functional/heketi/test_heketi_zones.py
+++ b/tests/functional/heketi/test_heketi_zones.py
@@ -617,11 +617,11 @@ class TestHeketiZones(baseclass.BaseClass):
def _create_dcs_and_check_brick_placement(
self, prefix, sc_name, heketi_zone_checking, zone_count):
- app_pods = []
+ app_pods, count, label = [], 5, "testlabel=autotest"
# Create multiple PVCs using storage class
pvc_names = self.create_and_wait_for_pvcs(
- pvc_name_prefix=prefix, pvc_amount=5, sc_name=sc_name)
+ pvc_name_prefix=prefix, pvc_amount=count, sc_name=sc_name)
# Create app dcs with I/O
for pvc_name in pvc_names:
@@ -629,10 +629,14 @@ class TestHeketiZones(baseclass.BaseClass):
self.node, pvc_name=pvc_name, dc_name_prefix=prefix)
self.addCleanup(openshift_ops.oc_delete, self.node, 'dc', app_dc)
- # Get pod names
+ # Get pod names and label them
pod_name = openshift_ops.get_pod_name_from_dc(self.node, app_dc)
+ openshift_ops.oc_label(self.node, 'pod', pod_name, label)
app_pods.append(pod_name)
+ # Wait for pods to be ready with the help of label selector
+ openshift_ops.wait_for_pods_be_ready(self.node, count, label)
+
# Validate brick placement in heketi zones
self._validate_brick_placement_in_correct_zone_or_with_expand_pvc(
heketi_zone_checking, pvc_name, zone_count)