From 13227d34d0f9a9b996c7aaf07f486beffcbda391 Mon Sep 17 00:00:00 2001 From: Bala Konda Reddy M Date: Thu, 28 Mar 2019 12:28:11 +0530 Subject: Validating peer is in connected or not In jenkins right after peer probe, add brick function is failing with peer not in cluster. So having check for the peer to be connected or not then proceed to next step. Change-Id: I73bf92819ad44f7a6a14795ab07c45d260cd04eb Signed-off-by: Bala Konda Reddy M --- tests/functional/glusterd/test_peer_status.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/functional/glusterd/test_peer_status.py b/tests/functional/glusterd/test_peer_status.py index dfe0668cd..cc282de57 100644 --- a/tests/functional/glusterd/test_peer_status.py +++ b/tests/functional/glusterd/test_peer_status.py @@ -15,6 +15,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import socket +from time import sleep from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass from glustolibs.gluster.exceptions import ExecutionError @@ -25,6 +26,7 @@ from glustolibs.gluster.lib_utils import form_bricks_list from glustolibs.gluster.peer_ops import (peer_probe, peer_status, peer_detach, peer_probe_servers, peer_detach_servers, + is_peer_connected, nodes_from_pool_list) @@ -129,6 +131,19 @@ class TestPeerStatus(GlusterBaseClass): g.log.info("Peer probe from %s to %s is success", self.mnode, self.servers[2]) + # Validate firts three peers are in connected state + # In jenkins The next step which is add-brick from thried node + # is failing with peer is not in cluster + count = 0 + while count < 30: + ret = is_peer_connected(self.mnode, self.servers[0:3]) + if ret: + g.log.info("Peers are in connected state") + break + sleep(3) + count = count + 1 + self.assertTrue(ret, "Some peers are not in connected state") + # add a brick from N3 to the volume num_bricks_to_add = 1 server_info = {} -- cgit