summaryrefslogtreecommitdiffstats
path: root/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py')
-rwxr-xr-xtests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py57
1 files changed, 29 insertions, 28 deletions
diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
index 63331ec73..083697b30 100755
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
@@ -19,11 +19,14 @@
refresh configs, cluster enable/disable functionality.
"""
-from time import sleep
+from copy import deepcopy
import os
import re
-from copy import deepcopy
+import sys
+from time import sleep
+
from glusto.core import Glusto as g
+
from glustolibs.gluster.gluster_base_class import runs_on
from glustolibs.gluster.nfs_ganesha_libs import (
NfsGaneshaClusterSetupClass,
@@ -57,7 +60,7 @@ class TestNfsGaneshaVolumeExports(NfsGaneshaClusterSetupClass):
"""
Setup nfs-ganesha if not exists.
"""
- NfsGaneshaClusterSetupClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Setup nfs-ganesha if not exists.
ret = cls.setup_nfs_ganesha()
@@ -197,9 +200,8 @@ class TestNfsGaneshaVolumeExports(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)
@runs_on([['replicated', 'distributed', 'distributed-replicated',
@@ -215,7 +217,7 @@ class TestNfsGaneshaVolumeExportsWithIO(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()
@@ -261,13 +263,14 @@ class TestNfsGaneshaVolumeExportsWithIO(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)
@@ -340,9 +343,8 @@ class TestNfsGaneshaVolumeExportsWithIO(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)
@runs_on([['replicated', 'distributed', 'distributed-replicated',
@@ -358,7 +360,7 @@ class TestNfsGaneshaMultiVolumeExportsWithIO(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()
@@ -402,13 +404,14 @@ class TestNfsGaneshaMultiVolumeExportsWithIO(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)
@@ -519,9 +522,8 @@ class TestNfsGaneshaMultiVolumeExportsWithIO(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)
@runs_on([['replicated', 'distributed', 'distributed-replicated',
@@ -537,7 +539,7 @@ class TestNfsGaneshaSubDirExportsWithIO(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()
@@ -571,14 +573,14 @@ class TestNfsGaneshaSubDirExportsWithIO(NfsGaneshaClusterSetupClass):
g.log.info("Starting IO on all mounts.")
self.all_mounts_procs = []
for mount_obj in mount_objs:
- 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 10 %s" % (self.script_upload_path,
- self.dir_start,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ sys.version_info.major, self.script_upload_path,
+ self.dir_start, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
self.all_mounts_procs.append(proc)
@@ -760,6 +762,5 @@ class TestNfsGaneshaSubDirExportsWithIO(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)