From bdc29bccfda390fd3cc2953b43a8653f7653c56f Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Mon, 9 Dec 2019 19:36:23 +0530 Subject: [py2to3] Add py3 support in 'tests/functional/nfs_ganesha' Change-Id: I7a76e0c2e491caffd7ba1b648b47c4c6a687c89a Signed-off-by: Valerii Ponomarov --- .../functional/nfs_ganesha/test_nfs_ganesha_sanity.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py') diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py index 9ee246fd8..e2a98876a 100755 --- a/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py +++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py @@ -17,7 +17,11 @@ """ Description: Test Cases in this module test NFS-Ganesha Sanity. """ + +import sys + from glusto.core import Glusto as g + from glustolibs.gluster.gluster_base_class import runs_on from glustolibs.gluster.nfs_ganesha_libs import ( NfsGaneshaClusterSetupClass) @@ -44,7 +48,7 @@ class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass): Setup nfs-ganesha if not exists. Upload IO scripts to clients """ - NfsGaneshaClusterSetupClass.setUpClass.im_func(cls) + cls.get_super_method(cls, 'setUpClass')() # Setup nfs-ganesha if not exists. ret = cls.setup_nfs_ganesha() @@ -105,13 +109,14 @@ class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass): 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) @@ -236,6 +241,5 @@ class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass): @classmethod def tearDownClass(cls): - (NfsGaneshaClusterSetupClass. - tearDownClass. - im_func(cls, delete_nfs_ganesha_cluster=False)) + cls.get_super_method(cls, 'tearDownClass')( + delete_nfs_ganesha_cluster=False) -- cgit