summaryrefslogtreecommitdiffstats
path: root/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py')
-rw-r--r--tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py59
1 files changed, 42 insertions, 17 deletions
diff --git a/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py b/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
index 12a825c2e..7b0865c0a 100644
--- a/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
+++ b/tests/functional/nfs_ganesha/test_nfs_ganesha_acls.py
@@ -19,32 +19,45 @@
ACL functionality.
"""
-from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import runs_on
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaVolumeBaseClass
-from glustolibs.gluster.nfs_ganesha_ops import enable_acl, disable_acl
-from glustolibs.gluster.exceptions import ExecutionError
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 (
+ wait_for_nfs_ganesha_volume_to_get_unexported)
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
+from glustolibs.gluster.exceptions import ExecutionError
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaAcls(NfsGaneshaVolumeBaseClass):
+class TestNfsGaneshaAcls(GlusterBaseClass):
"""
Tests to verify Nfs Ganesha v4 ACL stability
"""
-
- @classmethod
- def setUpClass(cls):
- NfsGaneshaVolumeBaseClass.setUpClass.im_func(cls)
-
def setUp(self):
- ret = enable_acl(self.servers[0], self.volname)
+ """
+ Setup Volume
+ """
+ self.get_super_method(self, 'setUp')()
+
+ # Setup and mount volume
+ g.log.info("Starting to setip and mount volume %s", self.volname)
+ ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
+ if not ret:
+ raise ExecutionError("Failed to setup and mount volume %s"
+ % self.volname)
+ g.log.info("Successful in setup and mount volume %s", self.volname)
+
+ # Enable ACL
+ ret = set_acl(self.mnode, self.volname)
if not ret:
raise ExecutionError("Failed to enable ACL on the nfs "
"ganesha cluster")
+ g.log.info("Successfully enabled ACL")
def test_nfsv4_acls(self):
# pylint: disable=too-many-locals
@@ -104,11 +117,23 @@ class TestNfsGaneshaAcls(NfsGaneshaVolumeBaseClass):
"acl test" % dirname)
def tearDown(self):
- ret = disable_acl(self.servers[0], self.volname)
+
+ # Disable ACL
+ ret = set_acl(self.mnode, self.volname, acl=False,
+ do_refresh_config=True)
if not ret:
raise ExecutionError("Failed to disable ACL on nfs "
"ganesha cluster")
-
- @classmethod
- def tearDownClass(cls):
- NfsGaneshaVolumeBaseClass.tearDownClass.im_func(cls)
+ # Unexport volume
+ unexport_nfs_ganesha_volume(self.mnode, self.volname)
+ ret = wait_for_nfs_ganesha_volume_to_get_unexported(self.mnode,
+ self.volname)
+ if not ret:
+ raise ExecutionError("Volume %s is not unexported." % self.volname)
+
+ # Unmount and cleanup Volume
+ ret = self.unmount_volume_and_cleanup_volume(self.mounts)
+ if ret:
+ g.log.info("Successfull unmount and cleanup of volume")
+ else:
+ raise ExecutionError("Failed to unmount and cleanup volume")