summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2018-12-27 12:22:27 +0530
committerVijay Avuthu <vavuthu@redhat.com>2019-01-22 13:31:20 +0000
commitafdc05b7dbb7b1021d7b01152c862287a9510b50 (patch)
treeccaa5360d529d5bce6e010c080d002cf7ed39929
parent3f9c3e3424039cbffb913e77b0f8a07465f0610e (diff)
Fix in teardown()
Change-Id: Ie44703a9d114b9ecaa5bbce07a98c8a040393f2c Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
-rw-r--r--tests/functional/glusterd/test_probe_hostname.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/functional/glusterd/test_probe_hostname.py b/tests/functional/glusterd/test_probe_hostname.py
index 6e7d87b..fde3557 100644
--- a/tests/functional/glusterd/test_probe_hostname.py
+++ b/tests/functional/glusterd/test_probe_hostname.py
@@ -43,6 +43,15 @@ class TestPeerProbe(GlusterBaseClass):
def tearDown(self):
+ # clean up all volumes and detaches peers from cluster
+ vol_list = get_volume_list(self.mnode)
+ for volume in vol_list:
+ ret = cleanup_volume(self.mnode, volume)
+ if not ret:
+ raise ExecutionError("Failed to Cleanup the "
+ "Volume %s" % volume)
+ g.log.info("Volume deleted successfully : %s", volume)
+
# Peer probe detached servers
pool = nodes_from_pool_list(self.mnode)
for node in pool:
@@ -54,20 +63,11 @@ class TestPeerProbe(GlusterBaseClass):
g.log.info("Peer probe success for detached "
"servers %s", self.servers)
- # clean up all volumes and detaches peers from cluster
-
- vol_list = get_volume_list(self.mnode)
- for volume in vol_list:
- ret = cleanup_volume(self.mnode, volume)
- if not ret:
- raise ExecutionError("Failed to Cleanup the "
- "Volume %s" % volume)
- g.log.info("Volume deleted successfully : %s", volume)
-
# Calling GlusterBaseClass tearDown
GlusterBaseClass.tearDown.im_func(self)
def test_peer_probe_validation(self):
+ # pylint: disable=too-many-statements
'''
-> Create trusted storage pool, by probing with networkshort names
-> Create volume using IP of host
@@ -89,6 +89,15 @@ class TestPeerProbe(GlusterBaseClass):
self.assertEqual(ret, 0, ("Unable to get short name "
"for server % s" % server))
ret, _, _ = peer_probe(self.mnode, hostname)
+
+ if ret == 1:
+ ret, hostname, _ = g.run(server, "hostname")
+ self.assertEqual(ret, 0, ("Unable to get short name "
+ "for server % s" % server))
+
+ hostname = hostname.split(".")[0]+"."+hostname.split(".")[1]
+ ret, _, _ = peer_probe(self.mnode, hostname)
+
self.assertEqual(ret, 0, "Unable to peer"
"probe to the server % s" % hostname)
g.log.info("Peer probe succeeded for server %s", hostname)