summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPranav <prprakas@redhat.com>2020-07-28 13:48:30 +0530
committerArthy Loganathan <aloganat@redhat.com>2020-07-30 05:08:05 +0000
commit7f9209c7d49b1c20cdb6a7626a95172d6df85be2 (patch)
tree034d9ad2aec711133cad1f403d5f31b66d5bee62 /tests
parent0db380b90b85c54fdb1d29b870380c667fc9167c (diff)
[Libfix] Move NFS Ganesha support to GlusterBaseClass
Problem: NFS-Ganesha Tests inherits 'NfsGaneshaClusterSetupClass' whereas the other tests inherits 'GlusterBaseClass'. This causes a cyclic dependency when trying to run other modules with Nfs-Ganesha. Fix: 1. Move the Nfs-Ganesha dependencies to GlusterBaseClass 2. Modify the Nfs-Ganesha tests to inherit from GlusterBaseClass 3. Remove setup_nfs_ganesha method call from existing Ganesha tests as its invoked by default from GlusterBaseClass.SetUpClass Change-Id: I1e382fdb2b29585c097dfd0fea0b45edafb6442b Signed-off-by: Pranav <prprakas@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/nfs_ganesha/root-squash/test_nfs_ganesha_root_squash.py32
-rw-r--r--tests/functional/nfs_ganesha/root-squash/test_root_squash_with_glusterd_restart.py30
-rw-r--r--tests/functional/nfs_ganesha/test_cthon.py11
-rw-r--r--tests/functional/nfs_ganesha/test_ganesha_add_brick.py16
-rw-r--r--tests/functional/nfs_ganesha/test_ganesha_remove_brick.py16
-rw-r--r--tests/functional/nfs_ganesha/test_ganesha_replace_brick.py16
-rw-r--r--tests/functional/nfs_ganesha/test_new_mount_while_io_in_progress.py16
-rw-r--r--tests/functional/nfs_ganesha/test_new_volume_while_io_in_progress.py17
-rw-r--r--tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py25
-rw-r--r--tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py16
-rwxr-xr-xtests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py25
-rwxr-xr-xtests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py61
12 files changed, 42 insertions, 239 deletions
diff --git a/tests/functional/nfs_ganesha/root-squash/test_nfs_ganesha_root_squash.py b/tests/functional/nfs_ganesha/root-squash/test_nfs_ganesha_root_squash.py
index 67add4514..1f91b33d0 100644
--- a/tests/functional/nfs_ganesha/root-squash/test_nfs_ganesha_root_squash.py
+++ b/tests/functional/nfs_ganesha/root-squash/test_nfs_ganesha_root_squash.py
@@ -20,20 +20,19 @@
"""
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass,
- wait_for_nfs_ganesha_volume_to_get_unexported)
+ wait_for_nfs_ganesha_volume_to_get_unexported)
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
from glustolibs.gluster.nfs_ganesha_ops import (
- set_root_squash,
- unexport_nfs_ganesha_volume)
+ set_root_squash,
+ unexport_nfs_ganesha_volume)
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaRootSquash(GlusterBaseClass):
"""
Tests to verify Nfs Ganesha v3/v4 rootsquash stability
Steps:
@@ -45,20 +44,6 @@ class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
6. Check for owner and group for any file
7. Edit file created by root user
"""
- @classmethod
- def setUpClass(cls):
- """
- Setup nfs-ganesha if not exists.
- """
- cls.get_super_method(cls, 'setUpClass')()
-
- # Setup nfs-ganesha
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster"
- "ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
def setUp(self):
"""
Setup Volume
@@ -146,7 +131,7 @@ class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
for mount_obj in self.mounts:
cmd = ("echo hello > %s/file10" % mount_obj.mountpoint)
ret, _, _ = g.run(mount_obj.client_system, cmd)
- self.assertEqual(ret, 1, "nfsnobody user editing file created by "
+ self.assertEqual(ret, 1, "nfsnobody user editing file created by "
"root user should FAIL")
g.log.info("nfsnobody user failed to edit file "
"created by root user")
@@ -175,8 +160,3 @@ class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
g.log.info("Successfull unmount and cleanup of volume")
else:
raise ExecutionError("Failed to unmount and cleanup volume")
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/root-squash/test_root_squash_with_glusterd_restart.py b/tests/functional/nfs_ganesha/root-squash/test_root_squash_with_glusterd_restart.py
index 9e2a1197a..5ed925400 100644
--- a/tests/functional/nfs_ganesha/root-squash/test_root_squash_with_glusterd_restart.py
+++ b/tests/functional/nfs_ganesha/root-squash/test_root_squash_with_glusterd_restart.py
@@ -20,14 +20,13 @@
"""
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass,
- wait_for_nfs_ganesha_volume_to_get_unexported)
+ wait_for_nfs_ganesha_volume_to_get_unexported)
from glustolibs.io.utils import get_mounts_stat
from glustolibs.gluster.nfs_ganesha_ops import (
- set_root_squash,
- unexport_nfs_ganesha_volume)
+ set_root_squash,
+ unexport_nfs_ganesha_volume)
from glustolibs.gluster.gluster_init import (
is_glusterd_running, restart_glusterd)
from glustolibs.gluster.peer_ops import wait_for_peers_to_connect
@@ -38,21 +37,7 @@ from glustolibs.gluster.glusterfile import set_file_permissions
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
- @classmethod
- def setUpClass(cls):
- """
- Setup nfs-ganesha if not exists.
- """
- cls.get_super_method(cls, 'setUpClass')()
-
- # Setup nfs-ganesha
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster "
- "ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
+class TestNfsGaneshaRootSquash(GlusterBaseClass):
def setUp(self):
"""
Setup Volume
@@ -183,8 +168,3 @@ class TestNfsGaneshaRootSquash(NfsGaneshaClusterSetupClass):
g.log.info("Successful unmount and cleanup of volume")
else:
raise ExecutionError("Failed to unmount and cleanup volume")
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_cthon.py b/tests/functional/nfs_ganesha/test_cthon.py
index 9b950fe59..78232fdac 100644
--- a/tests/functional/nfs_ganesha/test_cthon.py
+++ b/tests/functional/nfs_ganesha/test_cthon.py
@@ -20,8 +20,7 @@
"""
from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import runs_on
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.io.utils import run_cthon
from glustolibs.misc.misc_libs import git_clone_and_compile
@@ -30,7 +29,7 @@ from glustolibs.misc.misc_libs import git_clone_and_compile
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestCthon(NfsGaneshaClusterSetupClass):
+class TestCthon(GlusterBaseClass):
"""
Cthon test on NFS Ganesha v4.0, v4.1
"""
@@ -42,12 +41,6 @@ class TestCthon(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Cloning the cthon test repo
cls.dir_name = "repo_dir"
link = 'git://linux-nfs.org/~steved/cthon04.git'
diff --git a/tests/functional/nfs_ganesha/test_ganesha_add_brick.py b/tests/functional/nfs_ganesha/test_ganesha_add_brick.py
index 946b64c3b..e3fc6adc9 100644
--- a/tests/functional/nfs_ganesha/test_ganesha_add_brick.py
+++ b/tests/functional/nfs_ganesha/test_ganesha_add_brick.py
@@ -16,8 +16,7 @@
from glusto.core import Glusto as g
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@@ -31,7 +30,7 @@ from glustolibs.gluster.volume_libs import (
@runs_on([['distributed-replicated', 'replicated', 'distributed',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestGaneshaAddBrick(NfsGaneshaClusterSetupClass):
+class TestGaneshaAddBrick(GlusterBaseClass):
"""
Test cases to validate add-brick and rebalance functionality on volumes
exported through nfs-ganesha
@@ -45,12 +44,6 @@ class TestGaneshaAddBrick(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -177,8 +170,3 @@ class TestGaneshaAddBrick(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_ganesha_remove_brick.py b/tests/functional/nfs_ganesha/test_ganesha_remove_brick.py
index efa731041..9e9cf39c2 100644
--- a/tests/functional/nfs_ganesha/test_ganesha_remove_brick.py
+++ b/tests/functional/nfs_ganesha/test_ganesha_remove_brick.py
@@ -15,8 +15,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from glusto.core import Glusto as g
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@@ -28,7 +27,7 @@ from glustolibs.gluster.volume_libs import (
@runs_on([['distributed', 'distributed-arbiter',
'distributed-replicated', 'distributed-dispersed'],
['nfs']])
-class TestGaneshaRemoveBrick(NfsGaneshaClusterSetupClass):
+class TestGaneshaRemoveBrick(GlusterBaseClass):
"""
This test case validates remove brick functionality on volumes exported
through nfs-ganesha
@@ -42,12 +41,6 @@ class TestGaneshaRemoveBrick(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
"file_dir_ops.py")
@@ -145,8 +138,3 @@ class TestGaneshaRemoveBrick(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_ganesha_replace_brick.py b/tests/functional/nfs_ganesha/test_ganesha_replace_brick.py
index 12cec1a74..f87fd03f2 100644
--- a/tests/functional/nfs_ganesha/test_ganesha_replace_brick.py
+++ b/tests/functional/nfs_ganesha/test_ganesha_replace_brick.py
@@ -16,8 +16,7 @@
from glusto.core import Glusto as g
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@@ -31,7 +30,7 @@ from glustolibs.gluster.heal_libs import monitor_heal_completion
@runs_on([['distributed-replicated', 'replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestGaneshaReplaceBrick(NfsGaneshaClusterSetupClass):
+class TestGaneshaReplaceBrick(GlusterBaseClass):
"""
Test cases to validate remove brick functionality on volumes
exported through nfs-ganesha
@@ -45,12 +44,6 @@ class TestGaneshaReplaceBrick(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -169,8 +162,3 @@ class TestGaneshaReplaceBrick(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_new_mount_while_io_in_progress.py b/tests/functional/nfs_ganesha/test_new_mount_while_io_in_progress.py
index 1c6fc313c..798d5b7df 100644
--- a/tests/functional/nfs_ganesha/test_new_mount_while_io_in_progress.py
+++ b/tests/functional/nfs_ganesha/test_new_mount_while_io_in_progress.py
@@ -15,8 +15,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from copy import deepcopy
from glusto.core import Glusto as g
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@@ -24,7 +23,7 @@ from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@runs_on([['replicated', 'distributed', 'distributed-replicated'],
['nfs']])
-class TestMountWhileIoInProgress(NfsGaneshaClusterSetupClass):
+class TestMountWhileIoInProgress(GlusterBaseClass):
"""
Test cases to validate new mount while IO is going on
"""
@@ -37,12 +36,6 @@ class TestMountWhileIoInProgress(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -141,8 +134,3 @@ class TestMountWhileIoInProgress(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_new_volume_while_io_in_progress.py b/tests/functional/nfs_ganesha/test_new_volume_while_io_in_progress.py
index c367d3006..e8491ebfb 100644
--- a/tests/functional/nfs_ganesha/test_new_volume_while_io_in_progress.py
+++ b/tests/functional/nfs_ganesha/test_new_volume_while_io_in_progress.py
@@ -22,8 +22,8 @@ from copy import deepcopy
from glusto.core import Glusto as g
from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass, wait_for_nfs_ganesha_volume_to_get_exported)
-from glustolibs.gluster.gluster_base_class import runs_on
+ wait_for_nfs_ganesha_volume_to_get_exported)
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import upload_scripts
from glustolibs.io.utils import validate_io_procs, get_mounts_stat
@@ -37,7 +37,7 @@ from glustolibs.gluster.nfs_ganesha_ops import export_nfs_ganesha_volume
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNewVolumeWhileIoInProgress(NfsGaneshaClusterSetupClass):
+class TestNewVolumeWhileIoInProgress(GlusterBaseClass):
"""
Test cases to verify creation, export and mount of new volume while IO is
going on another volume exported through nfs-ganesha.
@@ -50,12 +50,6 @@ class TestNewVolumeWhileIoInProgress(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -242,8 +236,3 @@ class TestNewVolumeWhileIoInProgress(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume %s", volume)
g.log.info("Volume %s deleted successfully", volume)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
index 5921f3b90..7b0865c0a 100644
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
@@ -19,40 +19,25 @@
ACL functionality.
"""
+import time
+import re
from glusto.core import Glusto as g
from glustolibs.gluster.nfs_ganesha_ops import (
set_acl,
unexport_nfs_ganesha_volume)
from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass,
- wait_for_nfs_ganesha_volume_to_get_unexported)
-from glustolibs.gluster.gluster_base_class import runs_on
+ wait_for_nfs_ganesha_volume_to_get_unexported)
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
-import time
-import re
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaAcls(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaAcls(GlusterBaseClass):
"""
Tests to verify Nfs Ganesha v4 ACL stability
"""
-
- @classmethod
- def setUpClass(cls):
- """
- Setup nfs-ganesha if not exists.
- """
- cls.get_super_method(cls, 'setUpClass')()
-
- # Setup nfs-ganesha
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setuo nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
def setUp(self):
"""
Setup Volume
diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py
index 39a50766a..0f9c17156 100644
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py
@@ -20,9 +20,8 @@
"""
from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaClusterSetupClass
from glustolibs.gluster.lib_utils import install_epel
from glustolibs.io.utils import run_bonnie, run_fio, run_mixed_io
@@ -30,7 +29,7 @@ from glustolibs.io.utils import run_bonnie, run_fio, run_mixed_io
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaWithDifferentIOPatterns(GlusterBaseClass):
"""
Tests Nfs Ganesha stability by running different IO Patterns
"""
@@ -42,12 +41,6 @@ class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Install epel
if not install_epel(cls.clients):
raise ExecutionError("Failed to install epel")
@@ -128,8 +121,3 @@ class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py
index 2bca6d1c9..18feef31b 100755
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_sanity.py
@@ -19,23 +19,21 @@
"""
from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import runs_on
-from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass)
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.misc.misc_libs import (
- upload_scripts,
- git_clone_and_compile)
+ upload_scripts,
+ git_clone_and_compile)
from glustolibs.gluster.nfs_ganesha_ops import (
- is_nfs_ganesha_cluster_in_healthy_state,
- set_acl)
+ is_nfs_ganesha_cluster_in_healthy_state,
+ set_acl)
from glustolibs.io.utils import validate_io_procs
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaSanity(GlusterBaseClass):
"""
Tests to verify NFS Ganesha Sanity.
"""
@@ -47,12 +45,6 @@ class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -233,8 +225,3 @@ class TestNfsGaneshaSanity(NfsGaneshaClusterSetupClass):
"Check log errors for more info")
else:
g.log.info("Test repo cleanup successfull on all clients")
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
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 1cc9a05a3..bb1f2f71e 100755
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_volume_exports.py
@@ -26,9 +26,8 @@ from time import sleep
from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import runs_on
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
from glustolibs.gluster.nfs_ganesha_libs import (
- NfsGaneshaClusterSetupClass,
wait_for_nfs_ganesha_volume_to_get_exported,
wait_for_nfs_ganesha_volume_to_get_unexported)
from glustolibs.gluster.nfs_ganesha_ops import (
@@ -49,23 +48,11 @@ from glustolibs.gluster.lib_utils import get_servers_unused_bricks_dict
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaVolumeExports(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaVolumeExports(GlusterBaseClass):
"""
Tests to verify Nfs Ganesha exports, cluster enable/disable
functionality.
"""
- @classmethod
- def setUpClass(cls):
- """
- Setup nfs-ganesha if not exists.
- """
- cls.get_super_method(cls, 'setUpClass')()
-
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
def setUp(self):
"""
@@ -250,16 +237,11 @@ class TestNfsGaneshaVolumeExports(NfsGaneshaClusterSetupClass):
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
-
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaVolumeExportsWithIO(GlusterBaseClass):
"""
Tests to verify nfs ganesha features when IO is in progress.
"""
@@ -271,12 +253,6 @@ class TestNfsGaneshaVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -391,16 +367,11 @@ class TestNfsGaneshaVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
-
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaMultiVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaMultiVolumeExportsWithIO(GlusterBaseClass):
"""
Tests to verify multiple volumes gets exported when IO is in progress.
"""
@@ -412,12 +383,6 @@ class TestNfsGaneshaMultiVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -568,16 +533,11 @@ class TestNfsGaneshaMultiVolumeExportsWithIO(NfsGaneshaClusterSetupClass):
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)
-
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaSubDirExportsWithIO(NfsGaneshaClusterSetupClass):
+class TestNfsGaneshaSubDirExportsWithIO(GlusterBaseClass):
"""
Tests to verify nfs-ganesha sub directory exports.
"""
@@ -589,12 +549,6 @@ class TestNfsGaneshaSubDirExportsWithIO(NfsGaneshaClusterSetupClass):
"""
cls.get_super_method(cls, 'setUpClass')()
- # Setup nfs-ganesha if not exists.
- ret = cls.setup_nfs_ganesha()
- if not ret:
- raise ExecutionError("Failed to setup nfs-ganesha cluster")
- g.log.info("nfs-ganesha cluster is healthy")
-
# Upload IO scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
@@ -807,8 +761,3 @@ class TestNfsGaneshaSubDirExportsWithIO(NfsGaneshaClusterSetupClass):
if not ret:
raise ExecutionError("Failed to cleanup volume")
g.log.info("Cleanup volume %s completed successfully", self.volname)
-
- @classmethod
- def tearDownClass(cls):
- cls.get_super_method(cls, 'tearDownClass')(
- delete_nfs_ganesha_cluster=False)