summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2018-05-08 17:08:08 +0530
committerJonathan Holloway <jholloway@redhat.com>2018-05-09 06:39:35 +0000
commitc6c16a1eed4e3105fc45640c59d67c136fc09b6d (patch)
tree576ce458beae4bff042f35f21da237108623fb86 /tests/functional/glusterd
parentec9a468e162f3cc00a588956fd6b29d9c0c2bfae (diff)
Fix replace brick failure and peer probe failure
The replace brick setUp function had a syntax error and a wrong assert. The peer probe tearDown method did not work in a situation where the test failed leading to cascading failures in other tests. Change-Id: Ia7e0d85bb88c0c9bc6d489b4d03dc7610fd4f129
Diffstat (limited to 'tests/functional/glusterd')
-rw-r--r--tests/functional/glusterd/test_glusterd_replace_brick.py2
-rw-r--r--tests/functional/glusterd/test_probe_hostname.py25
2 files changed, 12 insertions, 15 deletions
diff --git a/tests/functional/glusterd/test_glusterd_replace_brick.py b/tests/functional/glusterd/test_glusterd_replace_brick.py
index afcb8a85c..eec182f55 100644
--- a/tests/functional/glusterd/test_glusterd_replace_brick.py
+++ b/tests/functional/glusterd/test_glusterd_replace_brick.py
@@ -30,7 +30,7 @@ from glustolibs.gluster.brick_libs import are_bricks_online
@runs_on([['replicated', 'distributed-replicated', 'dispersed',
'distributed-dispersed'], ['glusterfs']])
class TestReplaceBrick(GlusterBaseClass):
- def setup(self):
+ def setUp(self):
GlusterBaseClass.setUp.im_func(self)
self.test_method_complete = False
# Creating a volume and starting it
diff --git a/tests/functional/glusterd/test_probe_hostname.py b/tests/functional/glusterd/test_probe_hostname.py
index 4b950c70f..55476edc0 100644
--- a/tests/functional/glusterd/test_probe_hostname.py
+++ b/tests/functional/glusterd/test_probe_hostname.py
@@ -18,7 +18,8 @@ import socket
from glusto.core import Glusto as g
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.peer_ops import (peer_probe, peer_detach,
- peer_probe_servers)
+ peer_probe_servers,
+ nodes_from_pool_list)
from glustolibs.gluster.lib_utils import form_bricks_list
from glustolibs.gluster.volume_ops import (volume_create, volume_start,
get_volume_list, volume_stop,
@@ -28,10 +29,6 @@ from glustolibs.gluster.exceptions import ExecutionError
class TestPeerProbe(GlusterBaseClass):
- @classmethod
- def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
- g.log.info("Starting %s ", cls.__name__)
def setUp(self):
# Performing peer detach
@@ -41,20 +38,21 @@ class TestPeerProbe(GlusterBaseClass):
if ret:
raise ExecutionError("Peer detach failed")
g.log.info("Peer detach SUCCESSFUL.")
- self.peer_probe = False
GlusterBaseClass.setUp.im_func(self)
def tearDown(self):
# Peer probe detached servers
- if not self.peer_probe:
- ret = peer_probe_servers(self.mnode, self.servers)
- if not ret:
- raise ExecutionError("Failed to probe detached "
- "servers %s" % self.servers)
- g.log.info("Peer probe success for detached "
- "servers %s", self.servers)
+ pool = nodes_from_pool_list(self.mnode)
+ for node in pool:
+ peer_detach(self.mnode, node)
+ ret = peer_probe_servers(self.mnode, self.servers)
+ if not ret:
+ raise ExecutionError("Failed to probe detached "
+ "servers %s" % self.servers)
+ g.log.info("Peer probe success for detached "
+ "servers %s", self.servers)
# clean up all volumes and detaches peers from cluster
@@ -94,7 +92,6 @@ class TestPeerProbe(GlusterBaseClass):
self.assertEqual(ret, 0, "Unable to peer"
"probe to the server % s" % hostname)
g.log.info("Peer probe succeeded for server %s", hostname)
- self.peer_probe = True
# Create a volume
self.volname = "test-vol"