summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBala Konda Reddy M <bmekala@redhat.com>2019-03-25 17:24:35 +0530
committerAkarsha Rai <akrai@redhat.com>2019-04-12 09:29:04 +0000
commit685b2b1a0fbfef68ba3b6c031609290e3d90b42b (patch)
treee89ac1b511c060f4ef3979a541c9d722eab4ef5f
parent7c1189a4a240df79e11d4275ab66395c3cd076fc (diff)
Validating whether peers are connected or not before volume creation
In jenkins this case is failing with peers are not connected while volume creation. Now having a check before creating the volume to make sure that peers are in cluster and in connected state after peer probe. Change-Id: I8aa9d2c4d1669475dd8867d42752a31604ff572f Signed-off-by: Bala Konda Reddy M <bmekala@redhat.com>
-rw-r--r--tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py b/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py
index f84c7db..3b81dc6 100644
--- a/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py
+++ b/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.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,7 +23,8 @@ from glustolibs.gluster.brick_libs import get_all_bricks
from glustolibs.gluster.volume_libs import (cleanup_volume)
from glustolibs.gluster.peer_ops import (peer_probe, peer_detach,
peer_probe_servers,
- nodes_from_pool_list)
+ nodes_from_pool_list,
+ is_peer_connected)
from glustolibs.gluster.lib_utils import form_bricks_list
from glustolibs.gluster.brick_ops import remove_brick
from glustolibs.gluster.exceptions import ExecutionError
@@ -101,6 +103,20 @@ class TestRemoveBrickAfterRestartGlusterd(GlusterBaseClass):
g.log.info("peer probe is success from %s to "
"%s", self.servers[0], self.servers[index])
+ # Validating whether the peer are connected or not
+ # In jenkins This case is failing saying peers are not in connected
+ # state, that is reason adding a check whether peers are connected
+ # or not
+ count = 0
+ while count < 30:
+ ret = is_peer_connected(self.mnode, my_servers)
+ 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")
+
self.volname = "testvol"
bricks_list = form_bricks_list(self.mnode, self.volname, 4,
my_servers,