diff options
Diffstat (limited to 'tests/functional/dht/test_rebalance_start_when_glusterd_down.py')
-rw-r--r-- | tests/functional/dht/test_rebalance_start_when_glusterd_down.py | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/tests/functional/dht/test_rebalance_start_when_glusterd_down.py b/tests/functional/dht/test_rebalance_start_when_glusterd_down.py index abe7eeac1..bca96d2cd 100644 --- a/tests/functional/dht/test_rebalance_start_when_glusterd_down.py +++ b/tests/functional/dht/test_rebalance_start_when_glusterd_down.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2019-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 @@ -16,7 +16,9 @@ from random import choice 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.rebalance_ops import ( @@ -40,7 +42,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") @@ -52,11 +54,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) @@ -69,14 +69,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 1 " "--dir-length 1 " "--max-num-of-dirs 1 " - "--num-of-files 1 %s" % (cls.script_upload_path, - index + 10, - mount_obj.mountpoint)) + "--num-of-files 1 %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) @@ -193,14 +193,12 @@ class RebalanceValidation(GlusterBaseClass): "Failed") g.log.info("All peers are in connected state") - @classmethod - def tearDownClass(cls): - # Unmount Volume and Cleanup Volume + # 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')() |