From 057b772753c31450b4de3c0607d3df62af0e6233 Mon Sep 17 00:00:00 2001 From: Arun Kumar Date: Tue, 7 Jul 2020 17:16:46 +0530 Subject: [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 --- tests/functional/heketi/test_heketi_zones.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/functional/heketi/test_heketi_zones.py b/tests/functional/heketi/test_heketi_zones.py index 10646ae9..a5e6fd3b 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) -- cgit