diff options
Diffstat (limited to 'tests/functional/dht/test_restart_glusterd_after_rebalance.py')
-rw-r--r-- | tests/functional/dht/test_restart_glusterd_after_rebalance.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/functional/dht/test_restart_glusterd_after_rebalance.py b/tests/functional/dht/test_restart_glusterd_after_rebalance.py index a21a16c49..408e309a1 100644 --- a/tests/functional/dht/test_restart_glusterd_after_rebalance.py +++ b/tests/functional/dht/test_restart_glusterd_after_rebalance.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2018-2020 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 @@ -15,6 +15,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 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.rebalance_ops import ( @@ -39,7 +40,7 @@ class RebalanceValidation(GlusterBaseClass): def setUpClass(cls): # Calling GlusterBaseClass setUpClass - GlusterBaseClass.setUpClass.im_func(cls) + cls.get_super_method(cls, 'setUpClass')() # Setup Volume and Mount Volume g.log.info("Starting to Setup Volume and Mount Volume") @@ -51,11 +52,9 @@ class RebalanceValidation(GlusterBaseClass): # 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_local_path = ("/usr/share/glustolibs/io/scripts/" - "file_dir_ops.py") cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/" "file_dir_ops.py") - ret = upload_scripts(cls.clients, script_local_path) + ret = upload_scripts(cls.clients, cls.script_upload_path) if not ret: raise ExecutionError("Failed to upload IO scripts to clients %s" % cls.clients) @@ -68,14 +67,14 @@ class RebalanceValidation(GlusterBaseClass): for index, mount_obj in enumerate(cls.mounts, start=1): g.log.info("Starting IO on %s:%s", mount_obj.client_system, mount_obj.mountpoint) - cmd = ("python %s create_deep_dirs_with_files " + cmd = ("/usr/bin/env python %s create_deep_dirs_with_files " "--dirname-start-num %d " "--dir-depth 2 " "--dir-length 2 " "--max-num-of-dirs 1 " - "--num-of-files 2 %s" % (cls.script_upload_path, - index + 10, - mount_obj.mountpoint)) + "--num-of-files 2 %s" % ( + cls.script_upload_path, + index + 10, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) cls.all_mounts_procs.append(proc) @@ -99,7 +98,7 @@ class RebalanceValidation(GlusterBaseClass): # Log Volume Info and Status before expanding the volume. g.log.info("Logging volume info and Status before expanding volume") - ret = log_volume_info_and_status(self.mnode, self.volume) + ret = log_volume_info_and_status(self.mnode, self.volname) g.log.info("Successful in logging volume info and status of " "volume %s", self.volname) @@ -120,7 +119,7 @@ class RebalanceValidation(GlusterBaseClass): # Log Volume Info and Status after expanding the volume g.log.info("Logging volume info and Status after expanding volume") - ret = log_volume_info_and_status(self.mnode, self.volume) + ret = log_volume_info_and_status(self.mnode, self.volname) # Start Rebalance g.log.info("Starting rebalance on the volume") @@ -132,7 +131,8 @@ class RebalanceValidation(GlusterBaseClass): # Wait for rebalance to complete g.log.info("Waiting for rebalance to complete") - ret = wait_for_rebalance_to_complete(self.mnode, self.volname) + ret = wait_for_rebalance_to_complete(self.mnode, self.volname, + timeout=1800) self.assertTrue(ret, ("Rebalance is not yet complete on the volume " "%s", self.volname)) g.log.info("Rebalance is successfully complete on the volume %s", @@ -164,14 +164,14 @@ class RebalanceValidation(GlusterBaseClass): g.log.info("Rebalance is NOT triggered on %s after glusterd " "restart", server) - @classmethod - def tearDownClass(cls): - # Unmount Volume and Cleanup Volume + def tearDown(self): + + # Unmount and cleanup original volume g.log.info("Starting to Unmount Volume and Cleanup Volume") - ret = cls.unmount_volume_and_cleanup_volume(mounts=cls.mounts) + ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts) if not ret: - raise ExecutionError("Failed to Unmount Volume and Cleanup Volume") - g.log.info("Successful in Unmount Volume and Cleanup Volume") + raise ExecutionError("Failed to umount the vol & cleanup Volume") + g.log.info("Successful in umounting the volume and Cleanup") # Calling GlusterBaseClass tearDown - GlusterBaseClass.tearDownClass.im_func(cls) + self.get_super_method(self, 'tearDown')() |