summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-12-09 22:49:55 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-12-17 05:27:30 +0000
commit5189557f8c3332e936842b3a21e44b5df21f7698 (patch)
tree85aa46f6912faacc6ed7107516b32c4a912add4d
parentcab83e31489002beda2478109aaa7daadddc215c (diff)
[py2to3] Add py3 support in 'tests/functional/samba'
Change-Id: Iae0f6e729c26e466d82c4133439bdd7021485e7f Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
-rw-r--r--glustolibs-gluster/glustolibs/gluster/samba_libs.py2
-rw-r--r--tests/functional/samba/test_stat_prefetch.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/samba_libs.py b/glustolibs-gluster/glustolibs/gluster/samba_libs.py
index c25eeb8..5c0f20a 100644
--- a/glustolibs-gluster/glustolibs/gluster/samba_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/samba_libs.py
@@ -295,7 +295,7 @@ def share_volume_over_smb(mnode, volname, smb_users_info):
g.log.error("Failed to enable mounting volumes using SMB")
return False
g.log.info("Successfully enabled mounting volumes using SMV for the "
- "smbusers: %s", str(smb_users_info.keys()))
+ "smbusers: %s", str(list(smb_users_info.keys())))
# Verify if volume is shared
ret = is_volume_exported(mnode, volname, "smb")
diff --git a/tests/functional/samba/test_stat_prefetch.py b/tests/functional/samba/test_stat_prefetch.py
index 6c876fd..ac3e6a6 100644
--- a/tests/functional/samba/test_stat_prefetch.py
+++ b/tests/functional/samba/test_stat_prefetch.py
@@ -21,7 +21,11 @@ Description:
set stat-prefetch off-on this should fail the
IO running on the mount point.
"""
+
+import sys
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.mount_ops import mount_volume
from glustolibs.gluster.exceptions import (ExecutionError)
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
@@ -41,7 +45,7 @@ class TestValidateCifs(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
g.log.info("Starting to Setup Volume and Mount Volume")
@@ -77,7 +81,7 @@ class TestValidateCifs(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_stat_prefetch(self):
@@ -99,10 +103,10 @@ class TestValidateCifs(GlusterBaseClass):
self.assertEqual(ret, 0, "Cifs Mount Failed")
g.log.info("Starting IO on %s:%s", mount_obj.client_system,
mount_obj.mountpoint)
- cmd = ("python %s create_files -f 10000"
+ cmd = ("/usr/bin/env python%d %s create_files -f 10000"
" --base-file-name ctdb-cifs "
" --fixed-file-size 10k %s/samba/"
- % (self.script_upload_path,
+ % (sys.version_info.major, self.script_upload_path,
mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,