diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-12-17 17:56:19 +0530 |
---|---|---|
committer | Bala Konda Reddy M <bmekala@redhat.com> | 2020-01-02 07:19:55 +0000 |
commit | 62aeeec189f145d521ebf719956a3fbc570af1ee (patch) | |
tree | 3545d970881d415e1934dd7f3ce09700ed54f66c /tests/functional/disperse | |
parent | b1fc01b6006a72e9a9828d64159ce19562a0956b (diff) |
[py2to3] Fix bunch of py3 incompatibilities
Change-Id: I2e85670e50e3dab8727295c34aa6ec4f1326c19d
Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
Diffstat (limited to 'tests/functional/disperse')
3 files changed, 40 insertions, 27 deletions
diff --git a/tests/functional/disperse/test_ec_fops_brickdown.py b/tests/functional/disperse/test_ec_fops_brickdown.py index 111523253..f7cac1fcf 100644 --- a/tests/functional/disperse/test_ec_fops_brickdown.py +++ b/tests/functional/disperse/test_ec_fops_brickdown.py @@ -19,7 +19,11 @@ Test Description: Tests File Operations on an EC volume when redundant bricks are brought down """ + +import sys + from glusto.core import Glusto as g + from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, runs_on) from glustolibs.gluster.exceptions import ExecutionError from glustolibs.misc.misc_libs import upload_scripts @@ -40,7 +44,7 @@ class TestFopsBrickdown(GlusterBaseClass): @classmethod def setUpClass(cls): # 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", @@ -56,7 +60,7 @@ class TestFopsBrickdown(GlusterBaseClass): def setUp(self): # 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 and Mount Volume") @@ -81,7 +85,7 @@ class TestFopsBrickdown(GlusterBaseClass): g.log.info("Successful in umounting the volume and Cleanup") # Calling GlusterBaseClass teardown - GlusterBaseClass.tearDown.im_func(self) + self.get_super_method(self, 'tearDown')() def test_fops_ec_brickdown(self): # pylint: disable=too-many-branches,too-many-statements,too-many-locals @@ -261,14 +265,14 @@ class TestFopsBrickdown(GlusterBaseClass): for mount_obj in self.mounts: 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%d %s create_deep_dirs_with_files " "--dirname-start-num %d " "--dir-depth 2 " "--dir-length 10 " "--max-num-of-dirs 5 " - "--num-of-files 5 %s/dir1" % (self.script_upload_path, - count, - mount_obj.mountpoint)) + "--num-of-files 5 %s/dir1" % ( + sys.version_info.major, self.script_upload_path, count, + mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) all_mounts_procs.append(proc) @@ -300,14 +304,14 @@ class TestFopsBrickdown(GlusterBaseClass): for mount_obj in self.mounts: 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%d %s create_deep_dirs_with_files " "--dirname-start-num %d " "--dir-depth 2 " "--dir-length 10 " "--max-num-of-dirs 5 " - "--num-of-files 5 %s/dir2" % (self.script_upload_path, - count, - mount_obj.mountpoint)) + "--num-of-files 5 %s/dir2" % ( + sys.version_info.major, self.script_upload_path, count, + mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) all_mounts_procs.append(proc) diff --git a/tests/functional/disperse/test_ec_reset.py b/tests/functional/disperse/test_ec_reset.py index 3f05e3f37..6b115ccb4 100644 --- a/tests/functional/disperse/test_ec_reset.py +++ b/tests/functional/disperse/test_ec_reset.py @@ -21,9 +21,12 @@ Test Description: or commit to reset a brick with source and destination defined """ from os import getcwd -from time import sleep from random import choice +import sys +from time import sleep + from glusto.core import Glusto as g + from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, runs_on) from glustolibs.gluster.exceptions import ExecutionError from glustolibs.gluster.heal_libs import (monitor_heal_completion) @@ -46,7 +49,7 @@ class TestBrickReset(GlusterBaseClass): @classmethod def setUpClass(cls): # 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", @@ -62,7 +65,7 @@ class TestBrickReset(GlusterBaseClass): def setUp(self): # Calling GlusterBaseClass setUp - GlusterBaseClass.setUp.im_func(self) + self.get_super_method(self, 'setUp')() self.all_mounts_procs = [] self.io_validation_complete = False @@ -90,7 +93,7 @@ class TestBrickReset(GlusterBaseClass): g.log.info("Successful in umounting the volume and Cleanup") # Calling GlusterBaseClass teardown - GlusterBaseClass.tearDown.im_func(self) + self.get_super_method(self, 'tearDown')() def test_brickreset_ec_volume(self): # pylint: disable=too-many-branches,too-many-statements,too-many-locals @@ -165,9 +168,10 @@ class TestBrickReset(GlusterBaseClass): # Create dirs with file g.log.info('Creating dirs with file...') - command = ("python %s create_deep_dirs_with_files " - "-d 2 -l 2 -n 2 -f 20 %s/dir2" - % (self.script_upload_path, mount_obj.mountpoint)) + command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + "-d 2 -l 2 -n 2 -f 20 %s/dir2" % ( + sys.version_info.major, self.script_upload_path, + mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) @@ -337,9 +341,10 @@ class TestBrickReset(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create dirs with file g.log.info('Creating dirs with file...') - command = ("python %s create_deep_dirs_with_files " - "-d 2 -l 2 -n 2 -f 20 %s/dir1" - % (self.script_upload_path, mount_obj.mountpoint)) + command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + "-d 2 -l 2 -n 2 -f 20 %s/dir1" % ( + sys.version_info.major, self.script_upload_path, + mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py b/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py index 4847d9a45..42f742144 100644 --- a/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py +++ b/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py @@ -14,8 +14,11 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import sys from time import sleep + from glusto.core import Glusto as g + from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, runs_on) from glustolibs.gluster.exceptions import ExecutionError from glustolibs.gluster.volume_libs import get_subvols @@ -39,7 +42,7 @@ class TestHealFullNodeReboot(GlusterBaseClass): @classmethod def setUpClass(cls): # 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", @@ -55,7 +58,7 @@ class TestHealFullNodeReboot(GlusterBaseClass): def setUp(self): # Calling GlusterBaseClass setUp - GlusterBaseClass.setUp.im_func(self) + self.get_super_method(self, 'setUp')() # Setup Volumes self.all_mounts_procs = [] @@ -99,7 +102,7 @@ class TestHealFullNodeReboot(GlusterBaseClass): g.log.info("Successful in umounting the volume and Cleanup") # Calling GlusterBaseClass teardown - GlusterBaseClass.tearDown.im_func(self) + self.get_super_method(self, 'tearDown')() def test_heal_full_node_reboot(self): """ @@ -120,13 +123,14 @@ class TestHealFullNodeReboot(GlusterBaseClass): # Create dirs with file g.log.info('Creating dirs with file...') - command = ("python %s create_deep_dirs_with_files " + command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " "-d 2 " "-l 2 " "-n 2 " "-f 20 " - "%s" - % (self.script_upload_path, mount_obj.mountpoint)) + "%s" % ( + sys.version_info.major, self.script_upload_path, + mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) |