summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-01-22 20:32:03 +0530
committerVijay Avuthu <vavuthu@redhat.com>2019-01-23 06:50:43 +0000
commitb73f5f44d197bcb36ecb046c472c8fe8320a1e53 (patch)
treebc883dff1e56e8cc8b1c0c19b06771a0c28083db
parent45ea4788b1f6d3a6fe4419e0aea9e68cf6aa062b (diff)
Fixed jira issue RHGSQE-31
Change-Id: I627c78792c6c1ea12c4a023095a4a983f8cee9b0 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
-rw-r--r--tests/functional/glusterd/test_replace_brick_quorum_not_met.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/functional/glusterd/test_replace_brick_quorum_not_met.py b/tests/functional/glusterd/test_replace_brick_quorum_not_met.py
index 4484f17..4081c7d 100644
--- a/tests/functional/glusterd/test_replace_brick_quorum_not_met.py
+++ b/tests/functional/glusterd/test_replace_brick_quorum_not_met.py
@@ -63,8 +63,9 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
# Setting Quorum ratio to 51%
ret = set_volume_options(self.mnode, 'all',
{'cluster.server-quorum-ratio': '51%'})
- self.assertTrue(ret, "Failed to set server quorum ratio on %s"
- % self.servers)
+ if not ret:
+ raise ExecutionError("Failed to set server quorum ratio on %s"
+ % self.servers)
g.log.info("Able to set server quorum ratio successfully on %s",
self.servers)
@@ -76,11 +77,13 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
# Removing brick directories
if not self.replace_brick_failed:
- node, brick_path = self.random_brick.split(r':')
- cmd = "rm -rf " + brick_path
- ret, _, _ = g.run(node, cmd)
- if ret:
- raise ExecutionError("Failed to delete the brick dir's")
+ for brick in self.brick_list:
+ node, brick_path = brick.split(r':')
+ cmd = "rm -rf " + brick_path
+ ret, _, _ = g.run(node, cmd)
+ if ret:
+ raise ExecutionError("Failed to delete the brick "
+ "dir's of deleted volume")
# Calling GlusterBaseClass tearDown
GlusterBaseClass.tearDown.im_func(self)
@@ -103,12 +106,12 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
# Forming brick list, 6 bricks for creating volume, 7th brick for
# performing replace brick operation
- brick_list = form_bricks_list(self.mnode, self.volname, 7,
- self.servers, self.all_servers_info)
+ self.brick_list = form_bricks_list(self.mnode, self.volname, 7,
+ self.servers, self.all_servers_info)
# Create Volume
ret, _, _ = volume_create(self.mnode, self.volname,
- brick_list[0:6], replica_count=3)
+ self.brick_list[0:6], replica_count=3)
self.assertEqual(ret, 0, "Failed to create volume %s" % self.volname)
g.log.info("Volume created successfully %s", self.volname)
@@ -182,7 +185,7 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
# Performing replace brick commit force when quorum not met
self.replace_brick_failed = False
ret, _, _ = replace_brick(self.mnode, self.volname, self.random_brick,
- brick_list[6])
+ self.brick_list[6])
self.assertNotEqual(ret, 0, "Replace brick should fail when quorum is "
"in not met condition but replace brick "
"success on %s" % self.volname)
@@ -213,7 +216,7 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
count = 0
while count < 100:
ret = are_bricks_online(self.mnode, self.volname,
- brick_list[0:6])
+ self.brick_list[0:6])
if ret:
break
sleep(2)
@@ -225,7 +228,7 @@ class TestReplaceBrickWhenQuorumNotMet(GlusterBaseClass):
# Comparing brick lists of before and after performing replace brick
# operation
after_brick_list = get_all_bricks(self.mnode, self.volname)
- self.assertListEqual(after_brick_list, brick_list[0:6],
+ self.assertListEqual(after_brick_list, self.brick_list[0:6],
"Bricks are not same before and after performing "
"replace brick operation for volume %s"
% self.volname)