summaryrefslogtreecommitdiffstats
path: root/tests/functional/afr/test_client_side_quorum_with_cross2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/afr/test_client_side_quorum_with_cross2.py')
-rw-r--r--tests/functional/afr/test_client_side_quorum_with_cross2.py168
1 files changed, 96 insertions, 72 deletions
diff --git a/tests/functional/afr/test_client_side_quorum_with_cross2.py b/tests/functional/afr/test_client_side_quorum_with_cross2.py
index 142fcb886..6df722fb8 100644
--- a/tests/functional/afr/test_client_side_quorum_with_cross2.py
+++ b/tests/functional/afr/test_client_side_quorum_with_cross2.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2017 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2016-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,8 +17,8 @@
""" Description:
Test Cases in this module tests the client side quorum.
"""
-
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
from glustolibs.gluster.volume_libs import (
@@ -41,16 +41,14 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
@classmethod
def setUpClass(cls):
# Calling GlusterBaseClass setUpClass
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Upload io scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on mounts",
cls.clients)
- script_local_path = ("/usr/share/glustolibs/io/scripts/"
- "file_dir_ops.py")
cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
"file_dir_ops.py")
- ret = upload_scripts(cls.clients, [script_local_path])
+ ret = upload_scripts(cls.clients, cls.script_upload_path)
if not ret:
raise ExecutionError("Failed to upload IO scripts to clients %s"
% cls.clients)
@@ -79,7 +77,7 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
"""
# calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume and Mount Volume
g.log.info("Starting to Setup Volume %s", self.volname)
@@ -101,7 +99,7 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_client_side_quorum_with_auto_option_cross2(self):
"""
@@ -126,9 +124,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# Start IO on mounts
g.log.info("Starting IO .....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s" % (self.script_upload_path,
- self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -163,9 +162,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# create new file named newfile0.txt
g.log.info("Start creating new file on all mounts...")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 1 --base-file-name newfile %s" %
- (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 1 --base-file-name newfile %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -179,8 +179,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# create directory user1
g.log.info("Start creating directory on all mounts...")
all_mounts_procs = []
- cmd = ("python %s create_deep_dir %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = "/usr/bin/env python %s create_deep_dir %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint)
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -249,8 +250,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -274,8 +276,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# stat on dir
g.log.info("stat on directory on all mounts")
for mount_obj in self.mounts:
- cmd = ("python %s stat %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s stat %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
ret, _, _ = g.run(mount_obj.client_system, cmd)
self.assertFalse(ret, 'Failed to stat directory on %s'
% mount_obj.mountpoint)
@@ -285,8 +288,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# ls on mount point
g.log.info("ls on mount point on all mounts")
for mount_obj in self.mounts:
- cmd = ("python %s ls %s"
- % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s ls %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
ret, _, _ = g.run(mount_obj.client_system, cmd)
self.assertFalse(ret, 'Failed to ls on %s'
% mount_obj.mountpoint)
@@ -353,9 +357,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -370,8 +375,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -409,9 +415,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name second_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name second_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -426,8 +433,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -450,9 +458,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name third_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name third_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -467,8 +476,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -491,9 +501,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - read must pass, write will fail
g.log.info("Starting IO on mount......")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name fourth_file %s" %
- (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name fourth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -510,8 +521,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -535,9 +547,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name fifth_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name fifth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -552,8 +565,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -576,9 +590,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - read must pass, write will fail
g.log.info("Start creating files on mounts.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name sixth_file %s" %
- (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name sixth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -595,8 +610,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -619,9 +635,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name seventh_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name seventh_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -636,8 +653,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -661,9 +679,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name eigth_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name eigth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -678,8 +697,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -712,9 +732,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - read must pass, write will fail
g.log.info("Start creating files on mounts.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name ninth_file %s" %
- (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name ninth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -731,8 +752,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -755,9 +777,10 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("python %s create_files "
- "-f 10 --base-file-name tenth_file %s"
- % (self.script_upload_path, self.mounts[0].mountpoint))
+ cmd = ("/usr/bin/env python %s create_files "
+ "-f 10 --base-file-name tenth_file %s" % (
+ self.script_upload_path,
+ self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
all_mounts_procs.append(proc)
@@ -772,8 +795,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = ("python %s read "
- "%s" % (self.script_upload_path, mount_obj.mountpoint))
+ cmd = "/usr/bin/env python %s read %s" % (
+ self.script_upload_path,
+ mount_obj.mountpoint)
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)