summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-03-27 16:50:16 +0530
committerAkarsha Rai <akrai@redhat.com>2019-04-09 05:38:38 +0000
commitec891a0fdbeec5846fc1d1a42b476d257ae7a5f9 (patch)
tree379f1f3079c8c8d07839e94beee967d93f6a51cb
parent6ffc41fa15c782b13529474be7314630f8f0f09d (diff)
Checking if peers are connected after peer probe
Change-Id: I252ab0c0f6248b9a5c1d7977146c15876e144b38 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
-rw-r--r--tests/functional/glusterd/test_peer_probe.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/functional/glusterd/test_peer_probe.py b/tests/functional/glusterd/test_peer_probe.py
index 2426813..1db7b35 100644
--- a/tests/functional/glusterd/test_peer_probe.py
+++ b/tests/functional/glusterd/test_peer_probe.py
@@ -14,6 +14,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+from time import sleep
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,
@@ -22,6 +23,7 @@ from glustolibs.gluster.volume_ops import (volume_create, volume_start,
from glustolibs.gluster.volume_libs import (cleanup_volume)
from glustolibs.gluster.peer_ops import (peer_probe, peer_detach,
peer_probe_servers,
+ is_peer_connected,
nodes_from_pool_list)
from glustolibs.gluster.lib_utils import form_bricks_list
from glustolibs.gluster.exceptions import ExecutionError
@@ -164,6 +166,17 @@ class TestPeerProbe(GlusterBaseClass):
g.log.info("peer probe is success from %s to "
"%s", self.servers[0], self.servers[1])
+ # Checking if peer is connected
+ counter = 0
+ while counter < 30:
+ ret = is_peer_connected(self.servers[0], self.servers[1])
+ counter += 1
+ if ret:
+ break
+ sleep(3)
+ self.assertTrue(ret, "Peer is not in connected state.")
+ g.log.info("Peers is in connected state.")
+
# Perform peer probe from N3 to N2 should fail
ret, _, _ = peer_probe(self.servers[2], self.servers[1])
self.assertNotEqual(ret, 0, (
@@ -205,6 +218,17 @@ class TestPeerProbe(GlusterBaseClass):
g.log.info("peer probe is success from %s to "
"%s", self.servers[0], self.servers[2])
+ # Checking if peer is connected
+ counter = 0
+ while counter < 30:
+ ret = is_peer_connected(self.servers[0], self.servers[:3])
+ counter += 1
+ if ret:
+ break
+ sleep(3)
+ self.assertTrue(ret, "Peer is not in connected state.")
+ g.log.info("Peers is in connected state.")
+
# Create a replica volume on N1, N2 and N3 with force
number_of_brick = 3
server_info_from_three_node = {}