summaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/snapshot/test_256_snapshots.py18
-rw-r--r--tests/functional/snapshot/test_activate_deactivate.py6
-rw-r--r--tests/functional/snapshot/test_activate_on_create.py6
-rw-r--r--tests/functional/snapshot/test_auto_delete.py2
-rw-r--r--tests/functional/snapshot/test_clone_snap.py2
-rw-r--r--tests/functional/snapshot/test_create_brick_down.py4
-rw-r--r--tests/functional/snapshot/test_del_snap.py2
-rw-r--r--tests/functional/snapshot/test_mount_snap.py30
-rw-r--r--tests/functional/snapshot/test_restore_online_vol.py16
-rw-r--r--tests/functional/snapshot/test_snap_clone_from_snap.py14
-rw-r--r--tests/functional/snapshot/test_snap_delete_existing_scheduler.py14
-rw-r--r--tests/functional/snapshot/test_snap_delete_multiple.py22
-rw-r--r--tests/functional/snapshot/test_snap_delete_original_volume.py13
-rw-r--r--tests/functional/snapshot/test_snap_delete_snap_of_volume.py4
-rw-r--r--tests/functional/snapshot/test_snap_glusterd_down.py4
-rw-r--r--tests/functional/snapshot/test_snap_info.py4
-rw-r--r--tests/functional/snapshot/test_snap_info_glusterd_restart.py4
-rw-r--r--tests/functional/snapshot/test_snap_invalid_cases.py4
-rw-r--r--tests/functional/snapshot/test_snap_invalid_names.py6
-rw-r--r--tests/functional/snapshot/test_snap_list_after_restart.py2
-rw-r--r--tests/functional/snapshot/test_snap_rebalance.py16
-rw-r--r--tests/functional/snapshot/test_snap_scheduler_status.py4
-rw-r--r--tests/functional/snapshot/test_snap_self_heal.py25
-rw-r--r--tests/functional/snapshot/test_snap_uss.py21
-rw-r--r--tests/functional/snapshot/test_snap_uss_while_io.py13
-rw-r--r--tests/functional/snapshot/test_snapshot_create.py18
-rw-r--r--tests/functional/snapshot/test_snapshot_restore.py32
-rw-r--r--tests/functional/snapshot/test_uss_brick_down.py15
-rw-r--r--tests/functional/snapshot/test_uss_snap_active_deactive.py15
-rw-r--r--tests/functional/snapshot/test_validate_snap_del_gd_down.py2
-rw-r--r--tests/functional/snapshot/test_validate_snap_scheduler.py2
-rw-r--r--tests/functional/snapshot/test_validate_snaps_dir_over_uss.py24
-rw-r--r--tests/functional/snapshot/test_validate_snapshot_max_limit.py6
-rw-r--r--tests/functional/snapshot/test_validate_snapshot_rebalance.py16
34 files changed, 230 insertions, 156 deletions
diff --git a/tests/functional/snapshot/test_256_snapshots.py b/tests/functional/snapshot/test_256_snapshots.py
index 9c5ceaf..d25ae3b 100644
--- a/tests/functional/snapshot/test_256_snapshots.py
+++ b/tests/functional/snapshot/test_256_snapshots.py
@@ -18,7 +18,10 @@
Description : The purpose of this test is to validate create snap>256
"""
+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.misc.misc_libs import upload_scripts
@@ -46,7 +49,7 @@ class SanpCreate256(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- 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 +70,7 @@ class SanpCreate256(GlusterBaseClass):
setUp method
"""
# Setup_Volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts,
volume_create_force=True)
if not ret:
@@ -81,7 +84,7 @@ class SanpCreate256(GlusterBaseClass):
ret, _, _ = snap_delete_all(self.mnode)
if not ret:
raise ExecutionError("Failed to delete all snaps")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -94,7 +97,7 @@ class SanpCreate256(GlusterBaseClass):
raise ExecutionError("Failed to cleanup volume and mount")
g.log.info("Cleanup successful for the volume and mount")
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_validate_snaps_256(self):
@@ -104,13 +107,14 @@ class SanpCreate256(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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/snapshot/test_activate_deactivate.py b/tests/functional/snapshot/test_activate_deactivate.py
index 8a75509..d759313 100644
--- a/tests/functional/snapshot/test_activate_deactivate.py
+++ b/tests/functional/snapshot/test_activate_deactivate.py
@@ -41,7 +41,7 @@ class TestActivateDeactivate(GlusterBaseClass):
setup volume and initialize necessary variables
"""
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
g.log.info("Starting %s:", cls.__name__)
# Setup volume and mount
g.log.info("Starting to Setup Volume")
@@ -59,7 +59,7 @@ class TestActivateDeactivate(GlusterBaseClass):
raise ExecutionError("Snapshot Delete Failed")
g.log.info("Successfully deleted all snapshots")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -74,7 +74,7 @@ class TestActivateDeactivate(GlusterBaseClass):
g.log.info("Successful in Cleanup Volume and mount")
# calling GlusterBaseClass tearDownClass
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_activate_deactivate(self):
# pylint: disable=too-many-branches, too-many-statements
diff --git a/tests/functional/snapshot/test_activate_on_create.py b/tests/functional/snapshot/test_activate_on_create.py
index 3494bc3..82d8401 100644
--- a/tests/functional/snapshot/test_activate_on_create.py
+++ b/tests/functional/snapshot/test_activate_on_create.py
@@ -38,7 +38,7 @@ class TestActivateOnCreate(GlusterBaseClass):
setup volume and initialize necessary variables
"""
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
g.log.info("Starting %s:", cls.__name__)
# Setup volume and mount
g.log.info("Starting to Setup Volume")
@@ -68,7 +68,7 @@ class TestActivateOnCreate(GlusterBaseClass):
"activate-on-create")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -83,7 +83,7 @@ class TestActivateOnCreate(GlusterBaseClass):
g.log.info("Successful in Cleanup Volume and mount")
# calling GlusterBaseClass tearDownClass
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_activate_on_create(self):
# pylint: disable=too-many-branches, too-many-statements
diff --git a/tests/functional/snapshot/test_auto_delete.py b/tests/functional/snapshot/test_auto_delete.py
index db8a50f..40f729f 100644
--- a/tests/functional/snapshot/test_auto_delete.py
+++ b/tests/functional/snapshot/test_auto_delete.py
@@ -117,7 +117,7 @@ class DeleteSnapTests(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# disabling auto-delete
cmd = "gluster snapshot config auto-delete disable"
diff --git a/tests/functional/snapshot/test_clone_snap.py b/tests/functional/snapshot/test_clone_snap.py
index 6311a28..5129e35 100644
--- a/tests/functional/snapshot/test_clone_snap.py
+++ b/tests/functional/snapshot/test_clone_snap.py
@@ -48,7 +48,7 @@ class CloneSnapshot(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_create_brick_down.py b/tests/functional/snapshot/test_create_brick_down.py
index 529c39a..60ace2b 100644
--- a/tests/functional/snapshot/test_create_brick_down.py
+++ b/tests/functional/snapshot/test_create_brick_down.py
@@ -45,7 +45,7 @@ class CreateSnapwhenBricksareDown(GlusterBaseClass):
"""
def setUp(self):
# SetUp volume and Mount volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -135,7 +135,7 @@ class CreateSnapwhenBricksareDown(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Unmount and cleanup-volume
g.log.info("Starting to Unmount and cleanup-volume")
diff --git a/tests/functional/snapshot/test_del_snap.py b/tests/functional/snapshot/test_del_snap.py
index c7868a3..01a7151 100644
--- a/tests/functional/snapshot/test_del_snap.py
+++ b/tests/functional/snapshot/test_del_snap.py
@@ -35,7 +35,7 @@ class DeleteSnapshotTests(GlusterBaseClass):
"""
def setUp(self):
# SetUp volume and Mount volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_mount_snap.py b/tests/functional/snapshot/test_mount_snap.py
index 67b8a43..4e52e0e 100644
--- a/tests/functional/snapshot/test_mount_snap.py
+++ b/tests/functional/snapshot/test_mount_snap.py
@@ -22,7 +22,10 @@
"""
import os
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ConfigError, ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.gluster_base_class import runs_on
@@ -40,7 +43,7 @@ from glustolibs.gluster.mount_ops import create_mount_objs
class TestSnapMountSnapshot(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- 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)
@@ -63,7 +66,7 @@ class TestSnapMountSnapshot(GlusterBaseClass):
self.mount1 = []
self.mpoint = "/mnt/snap1"
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
raise ExecutionError("Failed to setup volume %s" % self.volname)
@@ -85,9 +88,10 @@ class TestSnapMountSnapshot(GlusterBaseClass):
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %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)
all_mounts_procs.append(proc)
@@ -149,9 +153,10 @@ class TestSnapMountSnapshot(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %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)
all_mounts_procs.append(proc)
@@ -167,9 +172,10 @@ class TestSnapMountSnapshot(GlusterBaseClass):
g.log.info("mounts: %s", self.mount1)
all_mounts_procs = []
for mount_obj in self.mount1:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %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)
all_mounts_procs.append(proc)
@@ -183,7 +189,7 @@ class TestSnapMountSnapshot(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# unmounting volume from Custom mount point
g.log.info("UnMounting mount point %s", self.mpoint)
diff --git a/tests/functional/snapshot/test_restore_online_vol.py b/tests/functional/snapshot/test_restore_online_vol.py
index 023e9ea..a7b407c 100644
--- a/tests/functional/snapshot/test_restore_online_vol.py
+++ b/tests/functional/snapshot/test_restore_online_vol.py
@@ -20,7 +20,10 @@ Description:
When we try to restore online volume it should fail.
"""
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.gluster_base_class import runs_on
@@ -37,7 +40,8 @@ class SnapRSOnline(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- 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)
@@ -54,7 +58,7 @@ class SnapRSOnline(GlusterBaseClass):
def setUp(self):
# SettingUp and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and mount volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -103,14 +107,14 @@ class SnapRSOnline(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 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 2 %s" % (self.script_upload_path,
- self.counter,
- mount_obj.mountpoint))
+ "--num-of-files 2 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.counter, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
diff --git a/tests/functional/snapshot/test_snap_clone_from_snap.py b/tests/functional/snapshot/test_snap_clone_from_snap.py
index 8b8e46e..3bf5218 100644
--- a/tests/functional/snapshot/test_snap_clone_from_snap.py
+++ b/tests/functional/snapshot/test_snap_clone_from_snap.py
@@ -21,7 +21,10 @@ Test Cases in this module tests the
Creation of clone volume from snapshot.
"""
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.gluster_base_class import runs_on
@@ -41,7 +44,7 @@ class SnapshotCloneValidate(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap = "snap0"
# Upload io scripts for running IO on mounts
@@ -58,8 +61,8 @@ class SnapshotCloneValidate(GlusterBaseClass):
g.log.info("Successfully uploaded IO scripts to clients %s")
def setUp(self):
+ self.get_super_method(self, 'setUp')()
- GlusterBaseClass.setUpClass.im_func(self)
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -91,9 +94,10 @@ class SnapshotCloneValidate(GlusterBaseClass):
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ sys.version_info.major, self.script_upload_path,
+ mount_obj.mountpoint))
proc = g.run(self.clients[0], cmd)
all_mounts_procs.append(proc)
g.log.info("Successfully Performed I/O on all mount points")
diff --git a/tests/functional/snapshot/test_snap_delete_existing_scheduler.py b/tests/functional/snapshot/test_snap_delete_existing_scheduler.py
index af5d867..0a29bbf 100644
--- a/tests/functional/snapshot/test_snap_delete_existing_scheduler.py
+++ b/tests/functional/snapshot/test_snap_delete_existing_scheduler.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.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
from glustolibs.misc.misc_libs import upload_scripts
@@ -40,7 +43,7 @@ class SnapshotDeleteExistingScheduler(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- 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)
@@ -58,7 +61,7 @@ class SnapshotDeleteExistingScheduler(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -180,9 +183,10 @@ class SnapshotDeleteExistingScheduler(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %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)
all_mounts_procs.append(proc)
diff --git a/tests/functional/snapshot/test_snap_delete_multiple.py b/tests/functional/snapshot/test_snap_delete_multiple.py
index a728331..2b4d26e 100644
--- a/tests/functional/snapshot/test_snap_delete_multiple.py
+++ b/tests/functional/snapshot/test_snap_delete_multiple.py
@@ -22,7 +22,10 @@ Creation of clone from snapshot of volume.
"""
import os
+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.volume_ops import volume_start
@@ -47,7 +50,7 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap1 = "snap1"
cls.snap2 = "snap21"
cls.clone1 = "clone1"
@@ -71,7 +74,7 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and mount volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -107,9 +110,10 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass):
mount_obj.client_system, mount_obj.mountpoint)
# Create files
g.log.info('Creating files...')
- command = ("python %s create_files -f 100 --fixed-file-size"
- " 1k %s" % (self.script_upload_path,
- mount_obj.mountpoint))
+ command = ("/usr/bin/env python%d %s create_files -f 100 "
+ "--fixed-file-size 1k %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)
all_mounts_procs.append(proc)
@@ -208,9 +212,9 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass):
g.log.info("Volume %s mounted on %s", clone, mpoint)
return 0
- value1 = range(0, 20)
- value2 = range(20, 30)
- value3 = range(30, 40)
+ value1 = list(range(0, 20))
+ value2 = list(range(20, 30))
+ value3 = list(range(30, 40))
ret1 = create_snap(value1, self.volname, self.snap1,
self.clone1, counter=20)
self.assertEqual(ret1, 30, "Failed")
@@ -237,7 +241,7 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass teardown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Disable Activate on create
option = {'activate-on-create': 'disable'}
diff --git a/tests/functional/snapshot/test_snap_delete_original_volume.py b/tests/functional/snapshot/test_snap_delete_original_volume.py
index 1bf62fd..4240ea5 100644
--- a/tests/functional/snapshot/test_snap_delete_original_volume.py
+++ b/tests/functional/snapshot/test_snap_delete_original_volume.py
@@ -23,7 +23,10 @@ and delete snapshot and original volume.
Validate cloned volume is not affected.
"""
+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.volume_libs import cleanup_volume
@@ -45,7 +48,7 @@ class SnapshotSelfheal(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.clone = "clone1"
cls.mpoint = "/mnt/clone1"
@@ -89,8 +92,10 @@ class SnapshotSelfheal(GlusterBaseClass):
"%s", mount_obj.client_system, mount_obj.mountpoint)
# Create files
g.log.info('Creating files...')
- command = ("python %s create_files -f 100 --fixed-file-size 1k %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ command = ("/usr/bin/env python%d %s create_files -f 100 "
+ "--fixed-file-size 1k %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)
all_mounts_procs.append(proc)
@@ -187,7 +192,7 @@ class SnapshotSelfheal(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass teardown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Cleanup cloned volume
g.log.info("Starting to delete cloned volume")
diff --git a/tests/functional/snapshot/test_snap_delete_snap_of_volume.py b/tests/functional/snapshot/test_snap_delete_snap_of_volume.py
index fdac200..6273647 100644
--- a/tests/functional/snapshot/test_snap_delete_snap_of_volume.py
+++ b/tests/functional/snapshot/test_snap_delete_snap_of_volume.py
@@ -37,7 +37,7 @@ class SnapshotDeleteSnapVolume(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
raise ExecutionError("Failed to setup volume %s" % self.volname)
@@ -45,7 +45,7 @@ class SnapshotDeleteSnapVolume(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Unmount and cleanup-volume
g.log.info("Unmount and cleanup-volume")
diff --git a/tests/functional/snapshot/test_snap_glusterd_down.py b/tests/functional/snapshot/test_snap_glusterd_down.py
index b6c030a..70cf765 100644
--- a/tests/functional/snapshot/test_snap_glusterd_down.py
+++ b/tests/functional/snapshot/test_snap_glusterd_down.py
@@ -42,12 +42,12 @@ class SnapshotGlusterddown(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap = "snap1"
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_snap_info.py b/tests/functional/snapshot/test_snap_info.py
index 004e880..6afd822 100644
--- a/tests/functional/snapshot/test_snap_info.py
+++ b/tests/functional/snapshot/test_snap_info.py
@@ -38,14 +38,14 @@ class SnapshotInfo(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap1 = "snap1"
cls.snap2 = "snap2"
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_snap_info_glusterd_restart.py b/tests/functional/snapshot/test_snap_info_glusterd_restart.py
index 13d9f0b..a9fc7aa 100644
--- a/tests/functional/snapshot/test_snap_info_glusterd_restart.py
+++ b/tests/functional/snapshot/test_snap_info_glusterd_restart.py
@@ -41,14 +41,14 @@ class SnapshotInfo(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap1 = "snap1"
cls.snap2 = "snap2"
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_snap_invalid_cases.py b/tests/functional/snapshot/test_snap_invalid_cases.py
index 6bbd8a2..e8bdb03 100644
--- a/tests/functional/snapshot/test_snap_invalid_cases.py
+++ b/tests/functional/snapshot/test_snap_invalid_cases.py
@@ -46,7 +46,7 @@ class SnapshotstatusInvalidcases(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap5 = "snap5"
cls.snap1 = "snap1"
cls.volname1 = "volume1"
@@ -54,7 +54,7 @@ class SnapshotstatusInvalidcases(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_snap_invalid_names.py b/tests/functional/snapshot/test_snap_invalid_names.py
index 775add5..a11d8ae 100644
--- a/tests/functional/snapshot/test_snap_invalid_names.py
+++ b/tests/functional/snapshot/test_snap_invalid_names.py
@@ -35,14 +35,14 @@ class SnapshotInvalidNames(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap1 = "snap1"
cls.snapinvalid = "#64^@*)"
cls.volname1 = "vola1"
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -51,7 +51,7 @@ class SnapshotInvalidNames(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Unmount and cleanup-volume
g.log.info("Unmount and cleanup-volume")
diff --git a/tests/functional/snapshot/test_snap_list_after_restart.py b/tests/functional/snapshot/test_snap_list_after_restart.py
index 52f34c1..4b73a2b 100644
--- a/tests/functional/snapshot/test_snap_list_after_restart.py
+++ b/tests/functional/snapshot/test_snap_list_after_restart.py
@@ -39,7 +39,7 @@ class SnapshotGlusterddown(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_snap_rebalance.py b/tests/functional/snapshot/test_snap_rebalance.py
index 8b68cd1..4c4b8c9 100644
--- a/tests/functional/snapshot/test_snap_rebalance.py
+++ b/tests/functional/snapshot/test_snap_rebalance.py
@@ -21,7 +21,10 @@ Test Cases in this module tests the
Creation of clone from snapshot of one volume.
"""
+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.mount_ops import mount_volume, is_mounted
@@ -43,7 +46,7 @@ class SnapshotRebalance(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap = "snap0"
cls.clone = "clone1"
cls.mount1 = "/mnt/clone1"
@@ -101,7 +104,7 @@ class SnapshotRebalance(GlusterBaseClass):
def setUp(self):
# SetUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -174,9 +177,10 @@ class SnapshotRebalance(GlusterBaseClass):
# write files to mountpoint
g.log.info("Starting IO on %s mountpoint...", self.mount1)
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- self.mount1))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.mount1))
proc = g.run(self.clients[0], cmd)
all_mounts_procs.append(proc)
@@ -232,4 +236,4 @@ class SnapshotRebalance(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')()
diff --git a/tests/functional/snapshot/test_snap_scheduler_status.py b/tests/functional/snapshot/test_snap_scheduler_status.py
index a337d83..fe81c4b 100644
--- a/tests/functional/snapshot/test_snap_scheduler_status.py
+++ b/tests/functional/snapshot/test_snap_scheduler_status.py
@@ -43,7 +43,7 @@ class SnapshotSchedulerStatus(GlusterBaseClass):
"""
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume()
if not ret:
@@ -74,7 +74,7 @@ class SnapshotSchedulerStatus(GlusterBaseClass):
g.log.info("Successful in Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_snap_scheduler_status(self):
# pylint: disable=too-many-statements
diff --git a/tests/functional/snapshot/test_snap_self_heal.py b/tests/functional/snapshot/test_snap_self_heal.py
index 10f8a53..7cd25b2 100644
--- a/tests/functional/snapshot/test_snap_self_heal.py
+++ b/tests/functional/snapshot/test_snap_self_heal.py
@@ -21,7 +21,10 @@ Test Cases in this module tests the
Creation of clone from snapshot of volume.
"""
+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.mount_ops import (mount_volume, umount_volume,
@@ -50,7 +53,7 @@ class SnapshotSelfheal(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
cls.snap = "snap1"
cls.clone = "clone1"
cls.mount1 = "/mnt/clone1"
@@ -72,7 +75,7 @@ class SnapshotSelfheal(GlusterBaseClass):
self.clients[0])
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -149,9 +152,10 @@ class SnapshotSelfheal(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mount1)
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s"
- % (self.script_upload_path, self.mount1))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.mount1))
proc = g.run(self.clients[0], cmd)
all_mounts_procs.append(proc)
g.log.info("Successful in creating I/O on mounts")
@@ -165,10 +169,10 @@ class SnapshotSelfheal(GlusterBaseClass):
g.log.info("Starting to bring bricks to offline")
bricks_to_bring_offline_dict = (select_bricks_to_bring_offline(
self.mnode, self.volname))
- bricks_to_bring_offline = filter(None, (
+ bricks_to_bring_offline = list(filter(None, (
bricks_to_bring_offline_dict['hot_tier_bricks'] +
bricks_to_bring_offline_dict['cold_tier_bricks'] +
- bricks_to_bring_offline_dict['volume_bricks']))
+ bricks_to_bring_offline_dict['volume_bricks'])))
g.log.info("Brick to bring offline: %s ", bricks_to_bring_offline)
ret = bring_bricks_offline(self.clone, bricks_to_bring_offline)
self.assertTrue(ret, "Failed to bring the bricks offline")
@@ -195,9 +199,10 @@ class SnapshotSelfheal(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mount1)
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- self.mount1))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.mount1))
proc = g.run(self.clients[0], cmd)
all_mounts_procs.append(proc)
g.log.info("Successful in creating I/O on mounts")
diff --git a/tests/functional/snapshot/test_snap_uss.py b/tests/functional/snapshot/test_snap_uss.py
index 60e06f3..288722d 100644
--- a/tests/functional/snapshot/test_snap_uss.py
+++ b/tests/functional/snapshot/test_snap_uss.py
@@ -21,7 +21,10 @@ Test Cases in this module tests the
Creation of snapshot and USS feature.
"""
+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)
@@ -46,7 +49,7 @@ class SnapshotUssSnap(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -89,9 +92,10 @@ class SnapshotUssSnap(GlusterBaseClass):
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %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)
all_mounts_procs.append(proc)
@@ -127,9 +131,10 @@ class SnapshotUssSnap(GlusterBaseClass):
ret = mkdir(mount_obj.client_system, self.mpoint)
self.assertTrue(ret, "Failed to create .snaps directory")
g.log.info("Successfully created .snaps directory")
- cmd = ("python %s create_files "
- "-f 10 --base-file-name foo %s"
- % (self.script_upload_path, self.mpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name foo %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.mpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -226,7 +231,7 @@ class SnapshotUssSnap(GlusterBaseClass):
def tearDown(self):
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# deleting created snapshots
g.log.info("Deleting all snapshots")
diff --git a/tests/functional/snapshot/test_snap_uss_while_io.py b/tests/functional/snapshot/test_snap_uss_while_io.py
index e8435c5..29ecb38 100644
--- a/tests/functional/snapshot/test_snap_uss_while_io.py
+++ b/tests/functional/snapshot/test_snap_uss_while_io.py
@@ -21,7 +21,10 @@ Test Cases in this module tests the
uss functionality while io is going on.
"""
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.gluster_base_class import runs_on
@@ -43,7 +46,7 @@ class SnapshotUssWhileIo(GlusterBaseClass):
@classmethod
def setUpClass(cls):
cls.snap_count = 10
- 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)
@@ -60,7 +63,7 @@ class SnapshotUssWhileIo(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and mount volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -124,8 +127,10 @@ class SnapshotUssWhileIo(GlusterBaseClass):
"%s", mount_obj.client_system, mount_obj.mountpoint)
# Create files
g.log.info('Creating files...')
- command = ("python %s create_files -f 100 --fixed-file-size 1M %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ command = ("/usr/bin/env python%d %s create_files -f 100 "
+ "--fixed-file-size 1M %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)
all_mounts_procs.append(proc)
diff --git a/tests/functional/snapshot/test_snapshot_create.py b/tests/functional/snapshot/test_snapshot_create.py
index e1bc9c2..44312b5 100644
--- a/tests/functional/snapshot/test_snapshot_create.py
+++ b/tests/functional/snapshot/test_snapshot_create.py
@@ -19,7 +19,10 @@ Description : The purpose of this test is to validate snapshot create
"""
+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.misc.misc_libs import upload_scripts
@@ -56,7 +59,7 @@ class SnapCreate(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- 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 "
@@ -77,7 +80,7 @@ class SnapCreate(GlusterBaseClass):
setUp method
"""
# Setup_Volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
raise ExecutionError("Failed to setup and mount volume")
@@ -90,7 +93,7 @@ class SnapCreate(GlusterBaseClass):
ret, _, _ = snap_delete_all(self.mnode)
if ret != 0:
raise ExecutionError("Failed to delete all snaps")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -103,7 +106,7 @@ class SnapCreate(GlusterBaseClass):
raise ExecutionError("Failed to cleanup volume and mount")
g.log.info("Cleanup successful for the volume and mount")
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_validate_snaps_create(self):
"""
@@ -158,13 +161,14 @@ class SnapCreate(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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/snapshot/test_snapshot_restore.py b/tests/functional/snapshot/test_snapshot_restore.py
index 966551b..b442879 100644
--- a/tests/functional/snapshot/test_snapshot_restore.py
+++ b/tests/functional/snapshot/test_snapshot_restore.py
@@ -18,7 +18,10 @@
The purpose of this test is to validate restore of a snapshot.
"""
+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.misc.misc_libs import upload_scripts
@@ -60,7 +63,7 @@ class SnapRestore(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- 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 "
@@ -81,7 +84,7 @@ class SnapRestore(GlusterBaseClass):
setUp method
"""
# Setup_Volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts,
volume_create_force=True)
if not ret:
@@ -95,7 +98,7 @@ class SnapRestore(GlusterBaseClass):
ret, _, _ = snap_delete_all(self.mnode)
if not ret:
raise ExecutionError("Snapshot delete failed.")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -108,7 +111,7 @@ class SnapRestore(GlusterBaseClass):
raise ExecutionError("Failed to cleanup volume and mount")
g.log.info("Cleanup successful for the volume and mount")
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_validate_snaps_restore(self):
# pylint: disable=too-many-statements
@@ -118,13 +121,14 @@ class SnapRestore(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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)
@@ -175,13 +179,14 @@ class SnapRestore(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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)
@@ -254,13 +259,14 @@ class SnapRestore(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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/snapshot/test_uss_brick_down.py b/tests/functional/snapshot/test_uss_brick_down.py
index 172b0f2..b543cdc 100644
--- a/tests/functional/snapshot/test_uss_brick_down.py
+++ b/tests/functional/snapshot/test_uss_brick_down.py
@@ -20,7 +20,10 @@ Description:
enable USS on the volume when brick is down.
"""
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass
from glustolibs.gluster.gluster_base_class import runs_on
@@ -41,7 +44,7 @@ class SnapUssBrickDown(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- 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)
@@ -58,7 +61,7 @@ class SnapUssBrickDown(GlusterBaseClass):
def setUp(self):
# SettingUp and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and mount volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -115,14 +118,14 @@ class SnapUssBrickDown(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 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 2 %s" % (self.script_upload_path,
- self.counter,
- mount_obj.mountpoint))
+ "--num-of-files 2 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.counter, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
diff --git a/tests/functional/snapshot/test_uss_snap_active_deactive.py b/tests/functional/snapshot/test_uss_snap_active_deactive.py
index 93c0231..aae1fe3 100644
--- a/tests/functional/snapshot/test_uss_snap_active_deactive.py
+++ b/tests/functional/snapshot/test_uss_snap_active_deactive.py
@@ -21,7 +21,10 @@ Description:
snap should not.
"""
+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.io.utils import (validate_io_procs,
@@ -42,7 +45,7 @@ class SnapUssActiveD(GlusterBaseClass):
@classmethod
def setUpClass(cls):
- 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)
@@ -59,7 +62,7 @@ class SnapUssActiveD(GlusterBaseClass):
def setUp(self):
# SettingUp and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp Volume and mount volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
@@ -121,14 +124,14 @@ class SnapUssActiveD(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 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 2 %s" % (self.script_upload_path,
- self.counter,
- mount_obj.mountpoint))
+ "--num-of-files 2 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.counter, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
diff --git a/tests/functional/snapshot/test_validate_snap_del_gd_down.py b/tests/functional/snapshot/test_validate_snap_del_gd_down.py
index fa14b1e..45229db 100644
--- a/tests/functional/snapshot/test_validate_snap_del_gd_down.py
+++ b/tests/functional/snapshot/test_validate_snap_del_gd_down.py
@@ -39,7 +39,7 @@ class SnapDelWhenGDDown(GlusterBaseClass):
def setUp(self):
# Setting and Mounting the volume
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to Set and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_validate_snap_scheduler.py b/tests/functional/snapshot/test_validate_snap_scheduler.py
index c8513ca..3f1cedc 100644
--- a/tests/functional/snapshot/test_validate_snap_scheduler.py
+++ b/tests/functional/snapshot/test_validate_snap_scheduler.py
@@ -44,7 +44,7 @@ class SnapshotSchedulerBehaviour(GlusterBaseClass):
def setUp(self):
# SettingUp volume and Mounting the volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
g.log.info("Starting to SetUp and Mount Volume")
ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
diff --git a/tests/functional/snapshot/test_validate_snaps_dir_over_uss.py b/tests/functional/snapshot/test_validate_snaps_dir_over_uss.py
index 8fcce00..740e918 100644
--- a/tests/functional/snapshot/test_validate_snaps_dir_over_uss.py
+++ b/tests/functional/snapshot/test_validate_snaps_dir_over_uss.py
@@ -23,7 +23,10 @@
"""
+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.misc.misc_libs import upload_scripts
@@ -48,7 +51,7 @@ class TestValidateUss(GlusterBaseClass):
setup volume and initialize necessary variables
"""
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Setup volume and mount
g.log.info("Starting to Setup Volume and Mount Volume")
ret = cls.setup_volume_and_mount_volume(mounts=cls.mounts)
@@ -90,7 +93,7 @@ class TestValidateUss(GlusterBaseClass):
"%s", self.volname)
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
@classmethod
def tearDownClass(cls):
@@ -105,7 +108,7 @@ class TestValidateUss(GlusterBaseClass):
g.log.info("Successful in Cleanup Volume and mount")
# calling GlusterBaseClass tearDownClass
- GlusterBaseClass.tearDownClass.im_func(cls)
+ cls.get_super_method(cls, 'tearDownClass')()
def test_validate_snaps_dir_over_uss(self):
@@ -124,14 +127,14 @@ class TestValidateUss(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 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 2 %s" % (self.script_upload_path,
- self.counter,
- mount_obj.mountpoint))
+ "--num-of-files 2 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.counter, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
@@ -203,9 +206,10 @@ class TestValidateUss(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s/.snaps/abc/"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = ("/usr/bin/env python%d %s create_files "
+ "-f 10 --base-file-name file %s/.snaps/abc/" % (
+ sys.version_info.major, self.script_upload_path,
+ 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/snapshot/test_validate_snapshot_max_limit.py b/tests/functional/snapshot/test_validate_snapshot_max_limit.py
index 3df2a98..4b16aa4 100644
--- a/tests/functional/snapshot/test_validate_snapshot_max_limit.py
+++ b/tests/functional/snapshot/test_validate_snapshot_max_limit.py
@@ -83,7 +83,7 @@ class SnapCreateMax(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- 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 "
@@ -104,7 +104,7 @@ class SnapCreateMax(GlusterBaseClass):
setUp method
"""
# Setup_Volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts,
volume_create_force=True)
if not ret:
@@ -118,7 +118,7 @@ class SnapCreateMax(GlusterBaseClass):
ret, _, _ = snap_delete_all(self.mnode)
if ret != 0:
raise ExecutionError("Failed to delete all snapshots.")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Clean up the volume & mount
g.log.info("Starting volume and mount cleanup")
diff --git a/tests/functional/snapshot/test_validate_snapshot_rebalance.py b/tests/functional/snapshot/test_validate_snapshot_rebalance.py
index f9e018d..61cf748 100644
--- a/tests/functional/snapshot/test_validate_snapshot_rebalance.py
+++ b/tests/functional/snapshot/test_validate_snapshot_rebalance.py
@@ -20,7 +20,10 @@ Description : The purpose of this test is to validate snapshot create
"""
+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.misc.misc_libs import upload_scripts
@@ -61,7 +64,7 @@ class SnapCreateRebal(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- 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 "
@@ -82,7 +85,7 @@ class SnapCreateRebal(GlusterBaseClass):
setUp method
"""
# Setup_Volume
- GlusterBaseClass.setUpClass.im_func(self)
+ self.get_super_method(self, 'setUp')()
ret = self.setup_volume_and_mount_volume(mounts=self.mounts,
volume_create_force=True)
if not ret:
@@ -96,7 +99,7 @@ class SnapCreateRebal(GlusterBaseClass):
ret, _, _ = snap_delete_all(self.mnode)
if not ret:
raise ExecutionError("Failed to delete all snaps")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
# Clean up the volume & mount
g.log.info("Starting volume and mount cleanup")
@@ -113,13 +116,14 @@ class SnapCreateRebal(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" % (self.script_upload_path, count,
- mount_obj.mountpoint))
+ "--num-of-files 5 %s" % (
+ 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)