diff options
Diffstat (limited to 'tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py')
-rw-r--r-- | tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py b/tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py index 71a47064f..b2652a4ea 100644 --- a/tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py +++ b/tests/functional/glusterd/test_glusterd_default_volume_behavior_quorum_options.py @@ -22,7 +22,9 @@ Description: from glusto.core import Glusto as g from glustolibs.gluster.exceptions import ExecutionError from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on -from glustolibs.gluster.volume_ops import get_volume_options +from glustolibs.gluster.volume_ops import ( + get_volume_options, + volume_reset) from glustolibs.gluster.gluster_init import ( stop_glusterd, start_glusterd, @@ -30,6 +32,7 @@ from glustolibs.gluster.gluster_init import ( wait_for_glusterd_to_start) from glustolibs.gluster.brick_libs import get_all_bricks from glustolibs.gluster.brickmux_ops import get_brick_processes_count +from glustolibs.gluster.peer_ops import wait_for_peers_to_connect @runs_on([['replicated', 'arbiter', 'dispersed', 'distributed', @@ -55,7 +58,8 @@ class TestGlusterDDefaultVolumeBehaviorQuorumOptions(GlusterBaseClass): else: ret = get_volume_options(self.mnode, 'all', option_name) self.assertIsNotNone(ret, "The %s option is not present" % option_name) - self.assertEqual(ret[option_name], option_value, + value = (ret[option_name]).split() + self.assertEqual(value[0], option_value, ("Volume option for %s is not equal to %s" % (option_name, option_value))) g.log.info("Volume option %s is equal to the expected value %s", @@ -81,10 +85,10 @@ class TestGlusterDDefaultVolumeBehaviorQuorumOptions(GlusterBaseClass): 4. There shouldn't be any effect to the running glusterfsd processes. """ - # Check that quorum options are not set by default. + # Check the default quorum options are correct. self._validate_vol_options('cluster.server-quorum-type', 'off') self._validate_vol_options('cluster.server-quorum-ratio', - '51 (DEFAULT)', True) + '51', True) # Get the count of number of glusterfsd processes running. count_before_glusterd_kill = self._get_total_brick_processes_count() @@ -119,11 +123,22 @@ class TestGlusterDDefaultVolumeBehaviorQuorumOptions(GlusterBaseClass): def tearDown(self): """tear Down Callback""" + # Wait for peers to connect. + ret = wait_for_peers_to_connect(self.mnode, self.servers, 50) + if not ret: + raise ExecutionError("Peers are not in connected state.") + # Unmount volume and cleanup. ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to Unmount and Cleanup volume") g.log.info("Successful in unmount and cleanup operations") + # Reset the cluster options. + ret = volume_reset(self.mnode, "all") + if not ret: + raise ExecutionError("Failed to Reset the cluster options.") + g.log.info("Successfully reset cluster options.") + # Calling GlusterBaseClass tearDown self.get_super_method(self, 'tearDown')() |