summaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
authorJilju Joy <jijoy@redhat.com>2019-05-13 23:09:15 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-10-23 09:13:19 +0000
commit0f149a21604cc545ad618014443230295cf71fd1 (patch)
treea459894650e3c5e2ad378fb8e75a4c07a57f94a5 /tests/functional
parent87feb4e7d8feb84c80cb13d5347fe40d44d2854e (diff)
nfs-ganesha: Modifying test case based on latest libraries
Change-Id: I2afd326fe0df1959a8fd20bc7325159688c1a73e Signed-off-by: Jilju Joy <jijoy@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/nfs_ganesha/test_nfs_ganesha_run_io_multiple_clients.py66
1 files changed, 58 insertions, 8 deletions
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 b6a1a4391..c8b9379df 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
@@ -22,7 +22,7 @@
from glusto.core import Glusto as g
from glustolibs.gluster.gluster_base_class import runs_on
from glustolibs.gluster.exceptions import ExecutionError
-from glustolibs.gluster.nfs_ganesha_libs import NfsGaneshaVolumeBaseClass
+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,19 +30,43 @@ from glustolibs.io.utils import run_bonnie, run_fio, run_mixed_io
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['nfs']])
-class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaVolumeBaseClass):
+class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaClusterSetupClass):
"""
Tests Nfs Ganesha stability by running different IO Patterns
"""
@classmethod
def setUpClass(cls):
- NfsGaneshaVolumeBaseClass.setUpClass.im_func(cls)
+ """
+ Setup nfs-ganesha if not exists.
+ """
+ NfsGaneshaClusterSetupClass.setUpClass.im_func(cls)
+
+ # 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")
- def test_run_bonnie_from_multiple_clients(self):
+ def setUp(self):
+ """
+ Setup and mount volume
+ """
+ g.log.info("Starting to setup 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)
+ def test_run_bonnie_from_multiple_clients(self):
+ """
+ Run bonnie test
+ """
directory_to_run = []
for mount in self.mounts:
directory_to_run.append(mount.mountpoint)
@@ -56,7 +80,9 @@ class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaVolumeBaseClass):
_, _, _ = g.run(self.servers[0], "pcs status")
def test_run_fio_from_multiple_clients(self):
-
+ """
+ Run fio
+ """
directory_to_run = []
for mount in self.mounts:
directory_to_run.append(mount.mountpoint)
@@ -70,7 +96,9 @@ class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaVolumeBaseClass):
_, _, _ = g.run(self.servers[0], "pcs status")
def test_run_mixed_io_from_multiple_clients(self):
-
+ """
+ Run multiple IOs
+ """
directory_to_run = []
for mount in self.mounts:
directory_to_run.append(mount.mountpoint)
@@ -79,8 +107,30 @@ class TestNfsGaneshaWithDifferentIOPatterns(NfsGaneshaVolumeBaseClass):
# TODO: parametrizing io_tools and get the inputs from user.
io_tools = ['bonnie', 'fio']
ret = run_mixed_io(self.clients, io_tools, directory_to_run)
- self.assertTrue(ret, ("fio test failed while running tests on %s"
- % self.clients))
+ self.assertTrue(ret, "IO failed on one or more clients.")
# pcs status output
_, _, _ = g.run(self.servers[0], "pcs status")
+
+ def tearDown(self):
+ """
+ Unmount and cleanup volume
+ """
+ # Unmount volume
+ ret = self.unmount_volume(self.mounts)
+ if ret:
+ g.log.info("Successfully unmounted the volume")
+ else:
+ g.log.error("Failed to unmount volume")
+
+ # Cleanup volume
+ ret = self.cleanup_volume()
+ if not ret:
+ raise ExecutionError("Failed to cleanup volume")
+ g.log.info("Cleanup volume %s completed successfully", self.volname)
+
+ @classmethod
+ def tearDownClass(cls):
+ (NfsGaneshaClusterSetupClass.
+ tearDownClass.
+ im_func(cls, delete_nfs_ganesha_cluster=False))