summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-12-16 18:26:45 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-12-18 10:26:37 +0000
commit065f51e673b3ccc39b153423359bed2dd572935d (patch)
treef1c998d24aa463f567b4742f1c74f95893ffedef
parentb1dfa315487c2da399988775e5de39354f686b0c (diff)
[py2to3] Add py3 support in 'tests/functional/dht'
Change-Id: I44fe85519c8fd381064670e54dac8736107b0928 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
-rw-r--r--tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py15
-rw-r--r--tests/functional/dht/test_dht_create_dir.py5
-rw-r--r--tests/functional/dht/test_dht_hash_value.py5
-rw-r--r--tests/functional/dht/test_dir_change_perm.py4
-rw-r--r--tests/functional/dht/test_dir_change_perm_recursive.py16
-rw-r--r--tests/functional/dht/test_directory_custom_extended_attributes.py10
-rw-r--r--tests/functional/dht/test_directory_healing.py4
-rw-r--r--tests/functional/dht/test_excerise_rebalance_command.py17
-rw-r--r--tests/functional/dht/test_induce_holes_in_layout_by_removebrick_commit_then_fixlayout.py2
-rw-r--r--tests/functional/dht/test_induce_holes_in_layout_by_removebrick_force_then_lookup.py2
-rw-r--r--tests/functional/dht/test_lookup_dir.py4
-rw-r--r--tests/functional/dht/test_mkdir_hashdown.py6
-rw-r--r--tests/functional/dht/test_negative_exercise_add_brick_command.py8
-rw-r--r--tests/functional/dht/test_rebalance_add_brick_command.py14
-rw-r--r--tests/functional/dht/test_rebalance_dir_file_from_multiple_clients.py15
-rw-r--r--tests/functional/dht/test_rebalance_start_when_glusterd_down.py15
-rw-r--r--tests/functional/dht/test_rebalance_while_remove_brick_is_in_progress.py15
-rw-r--r--tests/functional/dht/test_rebalance_with_hidden_files.py15
-rw-r--r--tests/functional/dht/test_remove_brick_while_rebalance_is_running.py15
-rw-r--r--tests/functional/dht/test_rename_directory.py5
-rw-r--r--tests/functional/dht/test_restart_glusterd_after_rebalance.py15
-rw-r--r--tests/functional/dht/test_stop_glusterd_while_rebalance_in_progress.py15
-rw-r--r--tests/functional/dht/test_verify_create_hash.py6
-rw-r--r--tests/functional/dht/test_volume_start_stop_while_rebalance_in_progress.py15
24 files changed, 134 insertions, 109 deletions
diff --git a/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py b/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
index 21297ce..bff9fc2 100644
--- a/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
+++ b/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -41,7 +42,7 @@ class RemoveBrickValidation(GlusterBaseClass):
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 "
@@ -60,7 +61,7 @@ class RemoveBrickValidation(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")
@@ -86,14 +87,14 @@ class RemoveBrickValidation(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 10 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -134,7 +135,7 @@ class RemoveBrickValidation(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_add_brick_while_remove_brick_is_in_progress(self):
# DHT Layout and hash validation
diff --git a/tests/functional/dht/test_dht_create_dir.py b/tests/functional/dht/test_dht_create_dir.py
index 2da4732..4b3cbbd 100644
--- a/tests/functional/dht/test_dht_create_dir.py
+++ b/tests/functional/dht/test_dht_create_dir.py
@@ -48,7 +48,8 @@ class TestDhtClass(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")
ret = cls.setup_volume_and_mount_volume(cls.mounts)
@@ -66,7 +67,7 @@ class TestDhtClass(GlusterBaseClass):
raise ExecutionError("Failed to clean-up volume")
g.log.info("Successful in cleaning up Volume %s", cls.volname)
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_create_directory(self):
diff --git a/tests/functional/dht/test_dht_hash_value.py b/tests/functional/dht/test_dht_hash_value.py
index c5f08dc..b7969b6 100644
--- a/tests/functional/dht/test_dht_hash_value.py
+++ b/tests/functional/dht/test_dht_hash_value.py
@@ -38,7 +38,8 @@ from glustolibs.gluster.glusterfile import (file_exists, get_fattr,
['glusterfs']])
class TestDHTHashValue(GlusterBaseClass):
def setUp(self):
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
+
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -216,4 +217,4 @@ class TestDHTHashValue(GlusterBaseClass):
if not ret:
g.log.error("Failed to Setup and Mount Volume")
raise ExecutionError('Failed to unmount and clean volumes')
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
diff --git a/tests/functional/dht/test_dir_change_perm.py b/tests/functional/dht/test_dir_change_perm.py
index c07cfb1..4ee2bcd 100644
--- a/tests/functional/dht/test_dir_change_perm.py
+++ b/tests/functional/dht/test_dir_change_perm.py
@@ -36,7 +36,7 @@ class DirChangePerm(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")
@@ -76,7 +76,7 @@ class DirChangePerm(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_dir_change_perm(self):
# pylint: disable=too-many-statements
diff --git a/tests/functional/dht/test_dir_change_perm_recursive.py b/tests/functional/dht/test_dir_change_perm_recursive.py
index 0ae02a9..4060d0a 100644
--- a/tests/functional/dht/test_dir_change_perm_recursive.py
+++ b/tests/functional/dht/test_dir_change_perm_recursive.py
@@ -14,6 +14,8 @@
# 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 glusto.core import Glusto as g
from glustolibs.gluster.constants import \
@@ -41,7 +43,7 @@ class DirChangePermRecursive(GlusterBaseClass):
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 "
@@ -59,7 +61,7 @@ class DirChangePermRecursive(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")
@@ -98,7 +100,7 @@ class DirChangePermRecursive(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_dir_change_perm_recursive(self):
# pylint: disable=too-many-statements
@@ -108,14 +110,14 @@ class DirChangePermRecursive(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 5 "
"--max-num-of-dirs 5 "
- "--num-of-files 5 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
diff --git a/tests/functional/dht/test_directory_custom_extended_attributes.py b/tests/functional/dht/test_directory_custom_extended_attributes.py
index 3323988..b391593 100644
--- a/tests/functional/dht/test_directory_custom_extended_attributes.py
+++ b/tests/functional/dht/test_directory_custom_extended_attributes.py
@@ -45,7 +45,7 @@ class TestDirectoryCustomExtendedAttributes(GlusterBaseClass):
"""
def setUp(self):
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -211,9 +211,9 @@ class TestDirectoryCustomExtendedAttributes(GlusterBaseClass):
command = 'ln -s {src} {dst}'.format(dst=linked_folder_name,
src=folder_name)
ret, _, _ = g.run(mount_point.client_system, command)
- self.assertEquals(0, ret,
- 'Failed to create link %s to directory %s' % (
- linked_folder_name, folder_name))
+ self.assertEqual(0, ret,
+ 'Failed to create link %s to directory %s' % (
+ linked_folder_name, folder_name))
self.assertTrue(file_exists(mount_point.client_system,
linked_folder_name),
'Link does not exists on %s:%s' %
@@ -359,4 +359,4 @@ class TestDirectoryCustomExtendedAttributes(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')()
diff --git a/tests/functional/dht/test_directory_healing.py b/tests/functional/dht/test_directory_healing.py
index 7783fb9..dd15867 100644
--- a/tests/functional/dht/test_directory_healing.py
+++ b/tests/functional/dht/test_directory_healing.py
@@ -44,7 +44,7 @@ class TestDirHeal(GlusterBaseClass):
"""
Setup and mount volume or raise ExecutionError
"""
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -136,4 +136,4 @@ class TestDirHeal(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_excerise_rebalance_command.py b/tests/functional/dht/test_excerise_rebalance_command.py
index b582df5..493a499 100644
--- a/tests/functional/dht/test_excerise_rebalance_command.py
+++ b/tests/functional/dht/test_excerise_rebalance_command.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.constants import \
TEST_LAYOUT_IS_COMPLETE as LAYOUT_IS_COMPLETE
from glustolibs.gluster.constants import FILETYPE_DIRS
@@ -51,7 +54,7 @@ class TestExerciseRebalanceCommand(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")
@@ -76,7 +79,7 @@ class TestExerciseRebalanceCommand(GlusterBaseClass):
def setUp(self):
# Calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Start IO on mounts
g.log.info("Starting IO on all mounts...")
@@ -84,14 +87,14 @@ class TestExerciseRebalanceCommand(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 10 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
@@ -373,4 +376,4 @@ class TestExerciseRebalanceCommand(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_commit_then_fixlayout.py b/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_commit_then_fixlayout.py
index d5d0956..448514c 100644
--- a/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_commit_then_fixlayout.py
+++ b/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_commit_then_fixlayout.py
@@ -37,7 +37,7 @@ class RebalanceValidation(GlusterBaseClass):
def setUp(self):
# Calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
if self.volume_type == "distributed-replicated":
self.volume_configs = []
diff --git a/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_force_then_lookup.py b/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_force_then_lookup.py
index a42f01f..c4acb67 100644
--- a/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_force_then_lookup.py
+++ b/tests/functional/dht/test_induce_holes_in_layout_by_removebrick_force_then_lookup.py
@@ -36,7 +36,7 @@ class RebalanceValidation(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")
diff --git a/tests/functional/dht/test_lookup_dir.py b/tests/functional/dht/test_lookup_dir.py
index 861b91a..40a2d12 100644
--- a/tests/functional/dht/test_lookup_dir.py
+++ b/tests/functional/dht/test_lookup_dir.py
@@ -59,7 +59,7 @@ class TestLookupDir(GlusterBaseClass):
"""
Setup and mount volume or raise ExecutionError
"""
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -277,4 +277,4 @@ class TestLookupDir(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_mkdir_hashdown.py b/tests/functional/dht/test_mkdir_hashdown.py
index ceb6d44..827dc32 100644
--- a/tests/functional/dht/test_mkdir_hashdown.py
+++ b/tests/functional/dht/test_mkdir_hashdown.py
@@ -43,7 +43,7 @@ class TestMkdirHashdown(GlusterBaseClass):
"""
Setup and mount volume or raise ExecutionError
"""
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -151,5 +151,5 @@ class TestMkdirHashdown(GlusterBaseClass):
raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
g.log.info("Successful in Unmount Volume and Cleanup Volume")
- # Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ # Calling GlusterBaseClass tearDownClass
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_negative_exercise_add_brick_command.py b/tests/functional/dht/test_negative_exercise_add_brick_command.py
index aab671f..3636414 100644
--- a/tests/functional/dht/test_negative_exercise_add_brick_command.py
+++ b/tests/functional/dht/test_negative_exercise_add_brick_command.py
@@ -37,12 +37,12 @@ class ExerciseAddbrickCommand(GlusterBaseClass):
def setUpClass(cls):
"""Upload the necessary scripts to run tests"""
# Calling GlusterBaseClass setUpClass
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
def setUp(self):
"""Setup Volume"""
# Calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume Volume
g.log.info("Starting to Setup Volume")
@@ -65,7 +65,7 @@ class ExerciseAddbrickCommand(GlusterBaseClass):
g.log.info("Volume deleted successfully : %s", volume)
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_add_brick_without_volname(self):
"""Test add-brick command without volume"""
@@ -158,7 +158,7 @@ class AddBrickAlreadyPartOfAnotherVolume(GlusterBaseClass):
raise ExecutionError("Unable to delete volume %s" % volume)
g.log.info("Volume deleted successfully : %s", volume)
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_add_brick_already_part_of_another_volume(self):
""" Test adding bricks to the volume which are already part of another
diff --git a/tests/functional/dht/test_rebalance_add_brick_command.py b/tests/functional/dht/test_rebalance_add_brick_command.py
index 17c5784..0ccc803 100644
--- a/tests/functional/dht/test_rebalance_add_brick_command.py
+++ b/tests/functional/dht/test_rebalance_add_brick_command.py
@@ -16,6 +16,8 @@
"""Positive test - Exercise Add-brick command"""
+import sys
+
from glusto.core import Glusto as g
from glustolibs.gluster.brick_libs import get_all_bricks
@@ -37,7 +39,7 @@ class ExerciseAddbrickCommand(GlusterBaseClass):
def setUp(self):
"""Setup Volume"""
# Calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume Volume
g.log.info("Starting to Setup Volume")
@@ -134,14 +136,14 @@ class ExerciseAddbrickCommand(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 10 %s" % (script_location,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, script_location, index + 10,
+ mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
# Expand volume
@@ -180,4 +182,4 @@ class ExerciseAddbrickCommand(GlusterBaseClass):
g.log.info("Volume deleted successfully : %s", volume)
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
diff --git a/tests/functional/dht/test_rebalance_dir_file_from_multiple_clients.py b/tests/functional/dht/test_rebalance_dir_file_from_multiple_clients.py
index bfd0683..537eafb 100644
--- a/tests/functional/dht/test_rebalance_dir_file_from_multiple_clients.py
+++ b/tests/functional/dht/test_rebalance_dir_file_from_multiple_clients.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -52,7 +53,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")
@@ -82,7 +83,7 @@ class RebalanceValidation(GlusterBaseClass):
- IO creates deep dirs and files.
"""
# 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")
@@ -113,14 +114,14 @@ class RebalanceValidation(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 5 "
"--max-num-of-dirs 5 "
- "--num-of-files 5 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
@@ -157,7 +158,7 @@ class RebalanceValidation(GlusterBaseClass):
g.log.info("Unmount Volume and Cleanup Volume: Success")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_expanding_volume_when_io_in_progress(self):
# pylint: disable=too-many-statements
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 abe7eea..ea6ae2b 100644
--- a/tests/functional/dht/test_rebalance_start_when_glusterd_down.py
+++ b/tests/functional/dht/test_rebalance_start_when_glusterd_down.py
@@ -15,8 +15,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from random import choice
+import sys
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 +43,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")
@@ -69,14 +72,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%d %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" % (
+ sys.version_info.major, 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)
@@ -203,4 +206,4 @@ class RebalanceValidation(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_rebalance_while_remove_brick_is_in_progress.py b/tests/functional/dht/test_rebalance_while_remove_brick_is_in_progress.py
index 6bc2c67..d1b5ddf 100644
--- a/tests/functional/dht/test_rebalance_while_remove_brick_is_in_progress.py
+++ b/tests/functional/dht/test_rebalance_while_remove_brick_is_in_progress.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -41,7 +42,7 @@ class RemoveBrickValidation(GlusterBaseClass):
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 "
@@ -60,7 +61,7 @@ class RemoveBrickValidation(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")
@@ -75,14 +76,14 @@ class RemoveBrickValidation(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 15 "
"--max-num-of-dirs 5 "
- "--num-of-files 5 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -123,7 +124,7 @@ class RemoveBrickValidation(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_rebalance_while_remove_brick_in_progress(self):
"""
diff --git a/tests/functional/dht/test_rebalance_with_hidden_files.py b/tests/functional/dht/test_rebalance_with_hidden_files.py
index d3357bc..47ccb0c 100644
--- a/tests/functional/dht/test_rebalance_with_hidden_files.py
+++ b/tests/functional/dht/test_rebalance_with_hidden_files.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -45,7 +46,7 @@ class RebalanceValidation(GlusterBaseClass):
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 "
@@ -67,7 +68,7 @@ class RebalanceValidation(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")
@@ -87,7 +88,7 @@ class RebalanceValidation(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_rebalance_with_hidden_files(self):
# pylint: disable=too-many-statements
@@ -97,10 +98,10 @@ class RebalanceValidation(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_files "
- "--base-file-name . "
- "-f 99 %s" % (self.script_upload_path,
- mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "--base-file-name . -f 99 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
diff --git a/tests/functional/dht/test_remove_brick_while_rebalance_is_running.py b/tests/functional/dht/test_remove_brick_while_rebalance_is_running.py
index c345d97..f726299 100644
--- a/tests/functional/dht/test_remove_brick_while_rebalance_is_running.py
+++ b/tests/functional/dht/test_remove_brick_while_rebalance_is_running.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -49,7 +50,7 @@ class RebalanceValidation(GlusterBaseClass):
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 "
@@ -68,7 +69,7 @@ class RebalanceValidation(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")
@@ -95,14 +96,14 @@ class RebalanceValidation(GlusterBaseClass):
for index, mount_obj in enumerate(self.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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 5 "
"--max-num-of-dirs 5 "
- "--num-of-files 10 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
@@ -143,7 +144,7 @@ class RebalanceValidation(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_remove_brick_while_rebalance_is_running(self):
diff --git a/tests/functional/dht/test_rename_directory.py b/tests/functional/dht/test_rename_directory.py
index cc383c0..ef2eae2 100644
--- a/tests/functional/dht/test_rename_directory.py
+++ b/tests/functional/dht/test_rename_directory.py
@@ -47,7 +47,7 @@ class TestDHTRenameDirectory(GlusterBaseClass):
"""
Setup and mount volume or raise ExecutionError
"""
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -288,5 +288,6 @@ class TestDHTRenameDirectory(GlusterBaseClass):
if not ret:
raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
g.log.info("Successful in Unmount Volume and Cleanup Volume")
+
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(self)
+ self.get_super_method(self, 'tearDown')()
diff --git a/tests/functional/dht/test_restart_glusterd_after_rebalance.py b/tests/functional/dht/test_restart_glusterd_after_rebalance.py
index 17bfee1..df87529 100644
--- a/tests/functional/dht/test_restart_glusterd_after_rebalance.py
+++ b/tests/functional/dht/test_restart_glusterd_after_rebalance.py
@@ -14,7 +14,10 @@
# 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 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 +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")
@@ -68,14 +71,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%d %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" % (
+ sys.version_info.major, 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)
@@ -174,4 +177,4 @@ class RebalanceValidation(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_stop_glusterd_while_rebalance_in_progress.py b/tests/functional/dht/test_stop_glusterd_while_rebalance_in_progress.py
index c9b6010..fccc0a9 100644
--- a/tests/functional/dht/test_stop_glusterd_while_rebalance_in_progress.py
+++ b/tests/functional/dht/test_stop_glusterd_while_rebalance_in_progress.py
@@ -15,8 +15,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import random
+import sys
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 (
@@ -43,7 +46,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")
@@ -72,14 +75,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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 3 "
"--dir-length 3 "
"--max-num-of-dirs 3 "
- "--num-of-files 10 %s" % (cls.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, 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)
@@ -215,4 +218,4 @@ class RebalanceValidation(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_verify_create_hash.py b/tests/functional/dht/test_verify_create_hash.py
index 23e9353..83f6a77 100644
--- a/tests/functional/dht/test_verify_create_hash.py
+++ b/tests/functional/dht/test_verify_create_hash.py
@@ -42,7 +42,7 @@ class TestCreateFile(GlusterBaseClass):
"""
Setup and mount volume or raise ExecutionError
"""
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume
ret = self.setup_volume_and_mount_volume(self.mounts)
@@ -162,5 +162,5 @@ class TestCreateFile(GlusterBaseClass):
raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
g.log.info("Successful in Unmount Volume and Cleanup Volume")
- # Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ # Calling GlusterBaseClass tearDownClass
+ cls.get_super_method(cls, 'tearDownClass')()
diff --git a/tests/functional/dht/test_volume_start_stop_while_rebalance_in_progress.py b/tests/functional/dht/test_volume_start_stop_while_rebalance_in_progress.py
index 6559a1e..ffbda61 100644
--- a/tests/functional/dht/test_volume_start_stop_while_rebalance_in_progress.py
+++ b/tests/functional/dht/test_volume_start_stop_while_rebalance_in_progress.py
@@ -14,6 +14,7 @@
# 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 glusto.core import Glusto as g
@@ -49,7 +50,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")
@@ -89,14 +90,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%d %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 1 "
"--dir-length 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 55 %s" % (cls.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 55 %s" % (
+ sys.version_info.major, 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)
@@ -220,5 +221,5 @@ class RebalanceValidation(GlusterBaseClass):
raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
g.log.info("Volume %s unmount and cleanup: Success", cls.volname)
- # Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDownClass.im_func(cls)
+ # Calling GlusterBaseClass tearDownClass
+ cls.get_super_method(cls, 'tearDownClass')()