From 19bcf32b75b4b68309ce2cba7ab402bf476e16b6 Mon Sep 17 00:00:00 2001 From: Vinayak Papnoi Date: Fri, 2 Aug 2019 15:18:42 +0530 Subject: Fix AFR test case tearDown The test case 'test_client_side_quorum_with_fixed_for_cross3' does not include the tearDown part where the volume options which have been set inside the test case have to be reset to default. This fix includes the necessary tearDown steps along with a few cosmetic changes. Change-Id: I86187cef4523492ec97707ff93d0eca365293008 Signed-off-by: Vinayak Papnoi --- ...est_client_side_quorum_with_fixed_for_cross3.py | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tests/functional/afr') diff --git a/tests/functional/afr/test_client_side_quorum_with_fixed_for_cross3.py b/tests/functional/afr/test_client_side_quorum_with_fixed_for_cross3.py index 3eea4894d..e074460e0 100755 --- a/tests/functional/afr/test_client_side_quorum_with_fixed_for_cross3.py +++ b/tests/functional/afr/test_client_side_quorum_with_fixed_for_cross3.py @@ -18,12 +18,14 @@ Test Cases in this module tests the client side quorum. """ +from time import sleep 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_libs import ( set_volume_options, get_subvols) from glustolibs.misc.misc_libs import upload_scripts +from glustolibs.gluster.volume_ops import reset_volume_option from glustolibs.gluster.brick_libs import (bring_bricks_offline, bring_bricks_online) from glustolibs.io.utils import (validate_io_procs, @@ -72,6 +74,19 @@ class ClientSideQuorumTestsWithSingleVolumeCross3(GlusterBaseClass): """ tearDown for every test """ + + # Reset the volume options set inside the test + g.log.info("Reset the volume options") + vol_options = ['cluster.self-heal-daemon', 'cluster.quorum-type', + 'cluster.quorum-count'] + for opt in vol_options: + ret, _, _ = reset_volume_option(self.mnode, self.volname, opt) + if ret != 0: + raise ExecutionError("Failed to reset the volume option %s" + % opt) + sleep(2) + g.log.info("Successfully reset the volume options") + # stopping the volume g.log.info("Starting to Unmount Volume and Cleanup Volume") ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts) @@ -216,8 +231,7 @@ class ClientSideQuorumTestsWithSingleVolumeCross3(GlusterBaseClass): offline_brick2_from_replicasets = [] for i in range(0, num_subvols): subvol_brick_list = subvols_dict['volume_subvols'][i] - g.log.info("sub-volume %s brick list : %s", - i, subvol_brick_list) + g.log.info("sub-volume %s brick list : %s", i, subvol_brick_list) brick_to_bring_offline2 = subvol_brick_list[1] g.log.info("Going to bring down the brick process " "for %s", brick_to_bring_offline2) @@ -346,8 +360,7 @@ class ClientSideQuorumTestsWithSingleVolumeCross3(GlusterBaseClass): g.log.info("bringing up the brick : %s online", offline_brick1_from_replicasets) ret = bring_bricks_online( - self.mnode, self.volname, - offline_brick1_from_replicasets, + self.mnode, self.volname, offline_brick1_from_replicasets, bring_bricks_online_methods='glusterd_restart') self.assertTrue(ret, ("Failed to brought the brick %s online" % offline_brick1_from_replicasets)) @@ -388,8 +401,7 @@ class ClientSideQuorumTestsWithSingleVolumeCross3(GlusterBaseClass): g.log.info("bringing up the brick : %s online", offline_brick2_from_replicasets) ret = bring_bricks_online( - self.mnode, self.volname, - offline_brick2_from_replicasets, + self.mnode, self.volname, offline_brick2_from_replicasets, bring_bricks_online_methods='glusterd_restart') self.assertTrue(ret, ("Failed to brought the brick %s online" % offline_brick2_from_replicasets)) -- cgit