From 5b5a1186385bc4cffa28db404eca313b455e8c6b Mon Sep 17 00:00:00 2001 From: Sri Vignesh Date: Thu, 26 Mar 2020 16:48:29 +0530 Subject: [testfix] Add steps in teardown to wait for all bricks online Add steps wait_for_bricks_to_be_online in teardown after the glusterd is started in teststeps Change-Id: Id30a3d870c6ba7c77b0e79604521ec41fe624822 Signed-off-by: Sri Vignesh --- tests/functional/glusterd/test_rebalance_hang.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/functional/glusterd') diff --git a/tests/functional/glusterd/test_rebalance_hang.py b/tests/functional/glusterd/test_rebalance_hang.py index 7911eb277..90b31d222 100644 --- a/tests/functional/glusterd/test_rebalance_hang.py +++ b/tests/functional/glusterd/test_rebalance_hang.py @@ -18,7 +18,8 @@ from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on from glustolibs.gluster.volume_ops import (volume_create, volume_start, get_volume_list, get_volume_status) -from glustolibs.gluster.brick_libs import get_all_bricks +from glustolibs.gluster.brick_libs import ( + get_all_bricks, wait_for_bricks_to_be_online) from glustolibs.gluster.volume_libs import (cleanup_volume) from glustolibs.gluster.peer_ops import (peer_probe, peer_detach, peer_probe_servers, @@ -61,6 +62,11 @@ class TestRebalanceHang(GlusterBaseClass): vol_list = get_volume_list(self.mnode) if vol_list is not None: for volume in vol_list: + # check all bricks are online + ret = wait_for_bricks_to_be_online(self.mnode, volume) + if not ret: + raise ExecutionError("Failed to bring bricks online" + "for volume %s" % volume) ret = cleanup_volume(self.mnode, volume) if not ret: raise ExecutionError("Failed to cleanup volume") -- cgit