summaryrefslogtreecommitdiffstats
path: root/tests/functional/afr/test_client_side_quorum_with_cross2.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-02-19 22:12:12 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-02-26 06:00:33 +0000
commitc7658429acadb6429d4d64ff04543dfbff478bc1 (patch)
treeffd15f8e3d05dac08a71129d3669d8d38d17f13c /tests/functional/afr/test_client_side_quorum_with_cross2.py
parent43e2ad8ff221022d1bc13a1194fff8ea2c3f5f3b (diff)
[Testfix] Remove python version dependency(Part 1)
sys library was added to all the testcases to fetch the `sys.version_info.major` which fetches the version of python with which glusto and glusto-tests is installed and runs the I/O script i.e file_dir_ops.py with that version of python but this creates a problem as older jobs running on older platforms won't run the way they use to, like if the older platform had python2 by default and we are running it tests from a slave which has python3 it'll fails and visa-versa. The problem is introduced due the below code: ``` cmd = ("/usr/bin/env python%d %s create_deep_dirs_with_files " "--dirname-start-num 10 --dir-depth 1 --dir-length 1 " "--max-num-of-dirs 1 --num-of-files 5 %s" % ( sys.version_info.major, self.script_upload_path, self.mounts[0].mountpoint)) ``` The solution to this problem is to change `python%d` to `python` which would enable the code to run with whatever version of python is avaliable on that client this would enable us to run any version of framework with both the older and latest platforms. Change-Id: I7c8200a7578f03c482f0c6a91832b8c0fdb33e77 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
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.py109
1 files changed, 53 insertions, 56 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 86e51ef86..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,9 +17,6 @@
""" Description:
Test Cases in this module tests the client side quorum.
"""
-
-import sys
-
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
@@ -127,9 +124,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# Start IO on mounts
g.log.info("Starting IO .....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -165,9 +162,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# create new file named newfile0.txt
g.log.info("Start creating new file on all mounts...")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 1 --base-file-name newfile %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -182,8 +179,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# create directory user1
g.log.info("Start creating directory on all mounts...")
all_mounts_procs = []
- cmd = "/usr/bin/env python%d %s create_deep_dir %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -253,8 +250,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -279,8 +276,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# stat on dir
g.log.info("stat on directory on all mounts")
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s stat %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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'
@@ -291,8 +288,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# ls on mount point
g.log.info("ls on mount point on all mounts")
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s ls %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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'
@@ -360,9 +357,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -378,8 +375,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -418,9 +415,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Starting IO on all mounts...")
g.log.info("mounts: %s", self.mounts)
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name second_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -436,8 +433,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -461,9 +458,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name third_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -479,8 +476,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -504,9 +501,9 @@ 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 = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name fourth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -524,8 +521,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -550,9 +547,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name fifth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -568,8 +565,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -593,9 +590,9 @@ 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 = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name sixth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -613,8 +610,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -638,9 +635,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name seventh_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -656,8 +653,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -682,9 +679,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name eigth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -700,8 +697,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -735,9 +732,9 @@ 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 = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name ninth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -755,8 +752,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)
@@ -780,9 +777,9 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
# start I/0 ( write and read ) - must succeed
g.log.info("Starting IO on mount.....")
all_mounts_procs = []
- cmd = ("/usr/bin/env python%d %s create_files "
+ cmd = ("/usr/bin/env python %s create_files "
"-f 10 --base-file-name tenth_file %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
self.mounts[0].mountpoint))
proc = g.run_async(self.mounts[0].client_system, cmd,
user=self.mounts[0].user)
@@ -798,8 +795,8 @@ class ClientSideQuorumCross2Tests(GlusterBaseClass):
g.log.info("Start reading files on all mounts")
all_mounts_procs = []
for mount_obj in self.mounts:
- cmd = "/usr/bin/env python%d %s read %s" % (
- sys.version_info.major, self.script_upload_path,
+ 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)