summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSri <sselvan@redhat.com>2018-09-18 06:37:38 -0400
committerSri Vignesh <sselvan@redhat.com>2018-09-18 12:59:09 +0000
commit157f5275fbe4005cd81a899e83d0b4d5453b1e6f (patch)
treecb9f18d30a2bde3961da4b43832a8282348c4881 /tests
parent957489592404f900d97a8ec56fb55144fe968c94 (diff)
Fix for test_add_brick_when_quorum_not_met.py
Change-Id: If8d18cd60d1993ce46fa019b659770cf6e7aa6b8 Signed-off-by: Sri <sselvan@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/glusterd/test_add_brick_when_quorum_not_met.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/tests/functional/glusterd/test_add_brick_when_quorum_not_met.py b/tests/functional/glusterd/test_add_brick_when_quorum_not_met.py
index f313784..c7d1513 100644
--- a/tests/functional/glusterd/test_add_brick_when_quorum_not_met.py
+++ b/tests/functional/glusterd/test_add_brick_when_quorum_not_met.py
@@ -19,7 +19,9 @@ 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.volume_libs import setup_volume
-from glustolibs.gluster.volume_ops import set_volume_options, get_volume_status
+from glustolibs.gluster.volume_ops import (set_volume_options,
+ get_volume_status,
+ volume_reset)
from glustolibs.gluster.gluster_init import (stop_glusterd, start_glusterd,
is_glusterd_running)
from glustolibs.gluster.brick_libs import get_all_bricks, are_bricks_offline
@@ -30,17 +32,6 @@ from glustolibs.gluster.lib_utils import form_bricks_list
@runs_on([['distributed'], ['glusterfs']])
class TestAddBrickWhenQuorumNotMet(GlusterBaseClass):
- def setUp(self):
-
- GlusterBaseClass.setUp.im_func(self)
-
- # check whether peers are in connected state
- ret = self.validate_peers_are_connected()
- if not ret:
- raise ExecutionError("Peers are not in connected state")
-
- g.log.info("Peers are in connected state")
-
def tearDown(self):
ret = is_glusterd_running(self.servers)
@@ -65,6 +56,12 @@ class TestAddBrickWhenQuorumNotMet(GlusterBaseClass):
g.log.info("Peers are in connected state")
+ # reset quorum ratio to default
+ g.log.info("resetting quorum ratio")
+ ret, _, _ = volume_reset(self.mnode, 'all')
+ self.assertEqual(ret, 0, "Failed to reset quorum ratio")
+ g.log.info("Successfully resetted quorum ratio")
+
# stopping the volume and Cleaning up the volume
ret = self.cleanup_volume()
if not ret:
@@ -137,23 +134,24 @@ class TestAddBrickWhenQuorumNotMet(GlusterBaseClass):
self.assertIsNotNone(bricks_list, "Failed to get the brick list")
bricks_to_check = bricks_list[0:num_of_nodes_to_bring_down]
ret = are_bricks_offline(self.mnode, self.volname, bricks_to_check)
- self.assertTrue(ret, "Server quorum is not met, Bricks are up")
- g.log.info("Server quorum is met, bricks are down")
+ self.assertTrue(ret, "Unexpected: Server quorum is not met, "
+ "Bricks are up")
+ g.log.info("Server quorum is not met, bricks are down as expected")
# try add brick operation, which should fail
num_bricks_to_add = 1
brick = form_bricks_list(self.mnode, self.volname, num_bricks_to_add,
self.servers, self.all_servers_info)
ret, _, _ = add_brick(self.mnode, self.volname, brick)
- self.assertNotEqual(ret, 0, ("add brick is success, when quorum is"
- " met"))
- g.log.info("Add brick is failed as expected, when quorum is met")
+ self.assertNotEqual(ret, 0, ("Unexpected: add brick is success, "
+ "when quorum is not met"))
+ g.log.info("Add brick is failed as expected, when quorum is not met")
# confirm that, newly added brick is not part of volume
bricks_list = get_all_bricks(self.mnode, self.volname)
self.assertIsNotNone(bricks_list, "Failed to get the brick list")
if brick in bricks_list:
ret = False
- self.assertTrue(ret, ("add brick is success, when quorum is"
- " met"))
- g.log.info("Add brick is failed as expected, when quorum is met")
+ self.assertTrue(ret, ("Unexpected: add brick is success, "
+ "when quorum is not met"))
+ g.log.info("Add brick is failed as expected, when quorum is not met")