summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py')
-rw-r--r--tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py b/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py
index d6c517923..64b968bb4 100644
--- a/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py
+++ b/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.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,22 +14,23 @@
# 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 runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
+from glustolibs.gluster.peer_ops import wait_for_peers_to_connect
from glustolibs.gluster.volume_libs import setup_volume
from glustolibs.gluster.volume_ops import set_volume_options
from glustolibs.gluster.gluster_init import (restart_glusterd,
- is_glusterd_running)
+ wait_for_glusterd_to_start,
+ is_glusterd_running,
+ start_glusterd)
@runs_on([['distributed'], ['glusterfs']])
class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass):
def setUp(self):
-
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# check whether peers are in connected state
ret = self.validate_peers_are_connected()
@@ -38,16 +39,17 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass):
def tearDown(self):
- count = 0
- while count < 60:
- ret = self.validate_peers_are_connected()
- if ret:
- break
- sleep(2)
- count += 1
+ 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)
- if not ret:
- raise ExecutionError("Peers are not in connected state")
+ ret = wait_for_peers_to_connect(self.mnode, self.servers)
+ self.assertTrue(ret, "glusterd is not connected %s with peer %s"
+ % (self.servers, self.servers))
# stopping the volume and Cleaning up the volume
ret = self.cleanup_volume()
@@ -56,7 +58,7 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass):
% self.volname)
g.log.info("Volume deleted successfully : %s", self.volname)
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_setting_vol_option_with_max_characters(self):
@@ -92,11 +94,9 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass):
ret = restart_glusterd(self.mnode)
self.assertTrue(ret, "Failed to restart the glusterd on %s"
% self.mnode)
- count = 0
- while count < 60:
- ret = is_glusterd_running(self.mnode)
- if not ret:
- break
- sleep(2)
- count += 1
- self.assertEqual(ret, 0, "glusterd is not running on %s" % self.mnode)
+
+ ret = wait_for_glusterd_to_start(self.servers)
+ self.assertTrue(ret, "glusterd is not running on %s"
+ % self.servers)
+ g.log.info("Glusterd start on the nodes : %s "
+ "succeeded", self.servers)