summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py
diff options
context:
space:
mode:
authorSri Vignesh <sselvan@redhat.com>2020-02-24 13:46:27 +0530
committerSri Vignesh <sselvan@redhat.com>2020-02-25 09:27:02 +0000
commit87638f2ab5379c04dfdf87329ebe450c24ac25bc (patch)
tree4456f11d1dfba028bdee646d53490e4938afbf06 /tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py
parent16a3b1f8dd1492fe45861cbd9f3a7d10f988c843 (diff)
[testfix] Add steps to stabilise glusterd
Moved steps from teardown class to teardown and removed unwanted teardown class and rectified the testcase failing with wait for io to complete by removing the step because after validate io the sub process terminates and results in failure. Change-Id: I2eaf05680b817b681aff8b48683fc9dac88896b0 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py')
-rw-r--r--tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py b/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py
index 6b6256872..ace2f2fb0 100644
--- a/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py
+++ b/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py
@@ -20,7 +20,6 @@
import sys
-from time import sleep
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
@@ -30,7 +29,10 @@ from glustolibs.gluster.brick_ops import add_brick
from glustolibs.gluster.rebalance_ops import (rebalance_start,
get_rebalance_status)
from glustolibs.gluster.gluster_init import (restart_glusterd,
- wait_for_glusterd_to_start)
+ wait_for_glusterd_to_start,
+ is_glusterd_running,
+ start_glusterd)
+from glustolibs.gluster.peer_ops import wait_for_peers_to_connect
from glustolibs.io.utils import validate_io_procs
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.gluster.glusterdir import get_dir_contents
@@ -90,18 +92,19 @@ class TestRestartGlusterdWhileRebalance(GlusterBaseClass):
"""
tearDown for every test
"""
+ 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)
+ g.log.info("Glusterd started successfully on %s", self.servers)
# checking for peer status from every node
- count = 0
- while count < 80:
- ret = self.validate_peers_are_connected()
- if ret:
- break
- sleep(2)
- count += 1
-
- if not ret:
- raise ExecutionError("Servers are not in peer probed state")
+ for server in self.servers:
+ ret = wait_for_peers_to_connect(server, self.servers)
+ if not ret:
+ raise ExecutionError("Servers are not in peer probed state")
# unmounting the volume and Cleaning up the volume
ret = self.unmount_volume_and_cleanup_volume(self.mounts)