From 7f9209c7d49b1c20cdb6a7626a95172d6df85be2 Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 28 Jul 2020 13:48:30 +0530 Subject: [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 --- .../nfs_ganesha/test_nfs_ganesha_sanity.py | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 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 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) -- cgit