summaryrefslogtreecommitdiffstats
path: root/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-12-12 22:10:49 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-12-17 08:28:18 +0000
commit099438eec88274839411f51cd214f6ff7fdac87c (patch)
treeeb9b0bb0967582e658a25f6f7d751ecacb3a0f9a /tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py
parente167fe2bd8d556ea79dc1cca424c0910f123ffdf (diff)
[py2to3] Add py3 support in 'tests/functional/arbiter'
Change-Id: I5a60646b984557ed024cb4b3a8088ce7dfb7622c Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
Diffstat (limited to 'tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py')
-rwxr-xr-xtests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py
index fadfc1150..2fd32a14d 100755
--- a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py
+++ b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.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.gluster_base_class import (GlusterBaseClass, runs_on)
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.volume_ops import set_volume_options
@@ -47,7 +50,7 @@ class TestSelfHeal(GlusterBaseClass):
@classmethod
def setUpClass(cls):
# Calling GlusterBaseClass setUpClass
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Overriding the volume type to specifically test the volume type
# Change from distributed-replicated to arbiter
@@ -75,7 +78,7 @@ class TestSelfHeal(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")
@@ -97,7 +100,7 @@ class TestSelfHeal(GlusterBaseClass):
g.log.info("Successful in umounting the volume and Cleanup")
# Calling GlusterBaseClass teardown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_data_self_heal_algorithm_diff_heal_command(self):
"""
@@ -148,8 +151,9 @@ class TestSelfHeal(GlusterBaseClass):
g.log.info("Generating data for %s:%s",
self.mounts[0].client_system, self.mounts[0].mountpoint)
# Creating files
- command = ("python %s create_files -f 100 %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ command = "/usr/bin/env python%d %s create_files -f 100 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.mounts[0].mountpoint)
proc = g.run_async(self.mounts[0].client_system, command,
user=self.mounts[0].user)
@@ -171,10 +175,10 @@ class TestSelfHeal(GlusterBaseClass):
# Select bricks to bring 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'])))
# Bring brick offline
g.log.info('Bringing bricks %s offline...', bricks_to_bring_offline)
@@ -193,8 +197,10 @@ class TestSelfHeal(GlusterBaseClass):
all_mounts_procs = []
g.log.info("Modifying data for %s:%s",
self.mounts[0].client_system, self.mounts[0].mountpoint)
- command = ("python %s create_files -f 100 --fixed-file-size 1M %s"
- % (self.script_upload_path, self.mounts[0].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,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, command,
user=self.mounts[0].user)