summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_glusterd_split_brain.py
diff options
context:
space:
mode:
authorSri Vignesh <sselvan@redhat.com>2020-02-20 17:09:10 +0530
committerSri Vignesh <sselvan@redhat.com>2020-02-20 13:32:44 +0000
commit16a3b1f8dd1492fe45861cbd9f3a7d10f988c843 (patch)
tree50e80fe7757f706c6bff0386881bb0f38655f88c /tests/functional/glusterd/test_glusterd_split_brain.py
parentdf5846416b7ba9c75a8ee6298af5629fabb2aec2 (diff)
[testfix] Add steps to add peer_probe_servers in cleanup
Change-Id: I0fa6bbacda16fb97d3454a8510a937442b5755a4 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional/glusterd/test_glusterd_split_brain.py')
-rw-r--r--tests/functional/glusterd/test_glusterd_split_brain.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/functional/glusterd/test_glusterd_split_brain.py b/tests/functional/glusterd/test_glusterd_split_brain.py
index ca60398bb..c8954da26 100644
--- a/tests/functional/glusterd/test_glusterd_split_brain.py
+++ b/tests/functional/glusterd/test_glusterd_split_brain.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2017-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,11 +14,11 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import time
+from time import sleep
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
-from glustolibs.gluster.peer_ops import is_peer_connected
+from glustolibs.gluster.peer_ops import is_peer_connected, peer_probe_servers
from glustolibs.gluster.volume_libs import (cleanup_volume,
setup_volume)
from glustolibs.gluster.volume_ops import (get_volume_list,
@@ -59,6 +59,24 @@ class GlusterdSplitBrainQuorumValidation(GlusterBaseClass):
def tearDown(self):
# stopping the volume and Cleaning up the volume
self.get_super_method(self, 'tearDown')()
+ ret = is_glusterd_running(self.servers)
+ if ret:
+ ret = start_glusterd(self.servers)
+ if not ret:
+ raise ExecutionError("Failed to start glusterd on %s"
+ % self.servers)
+ # Takes 5 seconds to restart glusterd into peer connected state
+ sleep(5)
+ g.log.info("Glusterd started successfully on %s", self.servers)
+
+ # checking for peer status from every node
+ ret = is_peer_connected(self.mnode, self.servers)
+ if not ret:
+ ret = peer_probe_servers(self.mnode, self.servers)
+ if not ret:
+ raise ExecutionError("Failed to peer probe failed in "
+ "servers %s" % self.servers)
+ g.log.info("All peers are in connected state")
vol_list = get_volume_list(self.mnode)
if vol_list is None:
raise ExecutionError("Failed to get the volume list")
@@ -138,7 +156,7 @@ class GlusterdSplitBrainQuorumValidation(GlusterBaseClass):
if not ret:
g.log.info("Peers are not connected state,"
" Retry after 2 seconds .......")
- time.sleep(2)
+ sleep(2)
counter = counter + 2
else:
_rc = True