diff options
Diffstat (limited to 'tests/functional/glusterd/test_detach_node_used_to_mount.py')
-rw-r--r-- | tests/functional/glusterd/test_detach_node_used_to_mount.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/functional/glusterd/test_detach_node_used_to_mount.py b/tests/functional/glusterd/test_detach_node_used_to_mount.py index 330899b5c..bbc2acc77 100644 --- a/tests/functional/glusterd/test_detach_node_used_to_mount.py +++ b/tests/functional/glusterd/test_detach_node_used_to_mount.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2019-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,7 +14,6 @@ # 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 random import randint from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on @@ -26,7 +25,7 @@ from glustolibs.gluster.rebalance_ops import (rebalance_start, rebalance_stop) from glustolibs.gluster.peer_ops import (peer_detach, peer_probe, - is_peer_connected) + wait_for_peers_to_connect) from glustolibs.gluster.brick_ops import add_brick from glustolibs.gluster.mount_ops import mount_volume, umount_volume from glustolibs.gluster.glusterfile import (get_fattr, file_exists, @@ -39,7 +38,7 @@ class TestChangeReservcelimit(GlusterBaseClass): @classmethod def setUpClass(cls): - GlusterBaseClass.setUpClass.im_func(cls) + cls.get_super_method(cls, 'setUpClass')() # Override Volumes setup cls.volume['voltype'] = { @@ -66,12 +65,10 @@ class TestChangeReservcelimit(GlusterBaseClass): g.log.info("Peer probe successful %s", self.servers[4]) # Wait till peers are in connected state - count = 0 - while count < 60: - ret = is_peer_connected(self.mnode, self.servers) - if ret: - break - sleep(3) + for server in self.servers: + ret = wait_for_peers_to_connect(self.mnode, server) + self.assertTrue(ret, "glusterd is not connected %s with peer %s" + % (self.mnode, server)) # Unmounting and cleaning volume ret, _, _ = umount_volume(mclient=self.mounts[0].client_system, @@ -84,7 +81,7 @@ class TestChangeReservcelimit(GlusterBaseClass): if not ret: raise ExecutionError("Unable to delete volume %s" % self.volname) g.log.info("Volume deleted successfully %s", self.volname) - GlusterBaseClass.tearDown.im_func(self) + self.get_super_method(self, 'tearDown')() def test_detach_node_used_to_mount(self): # pylint: disable=too-many-statements |