summaryrefslogtreecommitdiffstats
path: root/glustolibs-io
diff options
context:
space:
mode:
authorArjun Sharma <arjsharm@redhat.com>2019-07-19 14:23:29 +0530
committerArjun Sharma <arjsharm@redhat.com>2019-09-12 13:01:08 +0530
commitfee2d2d2b242c2423a8fa8c6f79db8d99082ac3e (patch)
treecc4e31e174fe89e614232f7fc8cf2e1ee6ce5a70 /glustolibs-io
parent32623566f1a12b9b6f22300b76f5941c5e8b8c75 (diff)
Cthon test case for NFS Ganesha
Change-Id: I3fb826bd0ecbe46bee4b9f8594b23f16921adbec Signed-off-by: Arjun Sharma <arjsharm@redhat.com>
Diffstat (limited to 'glustolibs-io')
-rwxr-xr-xglustolibs-io/glustolibs/io/utils.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/glustolibs-io/glustolibs/io/utils.py b/glustolibs-io/glustolibs/io/utils.py
index ba73b17..7bb8314 100755
--- a/glustolibs-io/glustolibs/io/utils.py
+++ b/glustolibs-io/glustolibs/io/utils.py
@@ -928,3 +928,47 @@ def run_crefi(client, mountpoint, number, breadth, depth, thread=5,
g.log.error("Failed to run crefi on %s." % client)
return False
return True
+
+
+def run_cthon(mnode, volname, clients, dir_name):
+ """This function runs the cthon test suite.
+
+ Args:
+ mnode (str) : IP of the server exporting the gluster volume.
+ volname (str) : The volume name.
+ clients (list) : List of client machines where
+ the test needs to be run.
+ dir_name (str) : Directory where the repo
+ is cloned.
+
+ Returns:
+ bool : True if the cthon test passes successfully
+ False otherwise.
+ """
+ param_list = ['-b', '-g', '-s', '-l']
+ vers_list = ['4.0', '4.1']
+
+ for client in clients:
+ g.log.info("Running tests on client %s" % client)
+ for vers in vers_list:
+ g.log.info("Running tests on client version %s" % vers)
+ for param in param_list:
+ # Initialising the test_type that will be running
+ if param == '-b':
+ test_type = "Basic"
+ elif param == '-g':
+ test_type = "General"
+ elif param == '-s':
+ test_type = "Special"
+ else:
+ test_type = "Lock"
+ g.log.info("Running %s test" % test_type)
+ cmd = ("cd /root/%s; ./server %s -o vers=%s -p %s -N "
+ "1 %s;" % (dir_name, param, vers, volname, mnode))
+ ret, _, _ = g.run(client, cmd)
+ if ret:
+ g.log.error("Error with %s test" % test_type)
+ return False
+ else:
+ g.log.info("%s test successfully passed" % test_type)
+ return True