diff options
Diffstat (limited to 'tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py')
-rwxr-xr-x | tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py b/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py index cf699b7d8..8e8652f6e 100755 --- a/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py +++ b/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2017 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2016-2019 Red Hat, Inc. <http://www.redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,11 +18,13 @@ 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.gluster.volume_ops import (set_volume_options, + reset_volume_option) +from glustolibs.gluster.volume_libs import get_subvols from glustolibs.misc.misc_libs import upload_scripts @@ -40,14 +42,14 @@ class ClientSideQuorumTests(GlusterBaseClass): """ # calling GlusterBaseClass setUpClass - GlusterBaseClass.setUpClass.im_func(cls) + cls.get_super_method(cls, 'setUpClass')() # Upload io scripts for running IO on mounts g.log.info("Upload io scripts to clients %s for running IO on " "mounts", cls.clients) - script_abs_path = "/usr/share/glustolibs/io/scripts/file_dir_ops.py" - cls.script_upload_path = script_abs_path - ret = upload_scripts(cls.clients, script_abs_path) + cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/" + "file_dir_ops.py") + ret = upload_scripts(cls.clients, cls.script_upload_path) if not ret: raise ExecutionError("Failed to upload IO scripts to clients") @@ -57,7 +59,7 @@ class ClientSideQuorumTests(GlusterBaseClass): """ # calling GlusterBaseClass setUp - GlusterBaseClass.setUp.im_func(self) + self.get_super_method(self, 'setUp')() # Setup Volume and Mount Volume g.log.info("Starting to Setup Volume %s", self.volname) @@ -71,6 +73,17 @@ class ClientSideQuorumTests(GlusterBaseClass): tearDown for every test """ + # Reset the volume options + g.log.info("Resetting the volume options") + options = ['cluster.quorum-type', 'cluster.quorum-count'] + for opt in 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) @@ -79,7 +92,7 @@ class ClientSideQuorumTests(GlusterBaseClass): g.log.info("Successful in Unmount Volume and Cleanup Volume") # Calling GlusterBaseClass tearDown - GlusterBaseClass.tearDown.im_func(self) + self.get_super_method(self, 'tearDown')() def test_client_side_quorum_with_fixed_validate_max_bricks(self): """ |