From 3e6d5bdc8c45ac3b726ca3b7237e43194805cc56 Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Thu, 20 Feb 2020 12:25:15 +0530 Subject: [Testfix] Remove python version dependency(Part 3) Please refer to commit message of patch [1]. [1] https://review.gluster.org/#/c/glusto-tests/+/24140/ Change-Id: Ib357d5690bb28131d788073b80a088647167fe80 Signed-off-by: kshithijiyer --- tests/functional/quota/test_limit_usage_deep_dir.py | 7 +++---- tests/functional/quota/test_quota_limit_dir_breadth.py | 12 +++++------- tests/functional/quota/test_quota_rebalance.py | 11 ++++------- tests/functional/quota/test_quota_rebalance_heal.py | 11 +++++------ tests/functional/quota/test_quota_single_brick_volume.py | 8 +++----- 5 files changed, 20 insertions(+), 29 deletions(-) (limited to 'tests/functional/quota') diff --git a/tests/functional/quota/test_limit_usage_deep_dir.py b/tests/functional/quota/test_limit_usage_deep_dir.py index 092bac416..94dacfe9f 100644 --- a/tests/functional/quota/test_limit_usage_deep_dir.py +++ b/tests/functional/quota/test_limit_usage_deep_dir.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2018 Red Hat, Inc. +# Copyright (C) 2015-2020 Red Hat, Inc. # # 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 @@ -15,7 +15,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import random -import sys from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, @@ -180,9 +179,9 @@ class LimitUsageDeepDir(GlusterBaseClass): # Data creation # Creates one file of rand[0] size in each dir rand = random.sample([1, 10, 512], 1) - cmd = ("/usr/bin/env python%d %s create_files " + cmd = ("/usr/bin/env python %s create_files " "--fixed-file-size %sk %s/%s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, rand[0], mount_object.mountpoint, dir_list[0])) ret, _, _ = g.run(mount_object.client_system, cmd) diff --git a/tests/functional/quota/test_quota_limit_dir_breadth.py b/tests/functional/quota/test_quota_limit_dir_breadth.py index eb23efceb..acaa82790 100755 --- a/tests/functional/quota/test_quota_limit_dir_breadth.py +++ b/tests/functional/quota/test_quota_limit_dir_breadth.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2018 Red Hat, Inc. +# Copyright (C) 2015-2020 Red Hat, Inc. # # 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 @@ -14,8 +14,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import sys - from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, @@ -102,8 +100,8 @@ class QuotaLimitDirBreadth(GlusterBaseClass): g.log.info("Creating Directories on %s:%s", client, mount_dir) - cmd = "/usr/bin/env python%d %s create_deep_dir -d 0 -l 10 %s" % ( - sys.version_info.major, self.script_upload_path, mount_dir) + cmd = "/usr/bin/env python %s create_deep_dir -d 0 -l 10 %s" % ( + self.script_upload_path, mount_dir) proc = g.run_async(client, cmd, user=mount_obj.user) self.all_mounts_procs.append(proc) @@ -151,9 +149,9 @@ class QuotaLimitDirBreadth(GlusterBaseClass): g.log.info("Creating Files on %s:%s", client, mount_dir) for i in range(1, 11): dir_name = "/user" + str(i) - cmd = ("/usr/bin/env python%d %s create_files -f 10 " + cmd = ("/usr/bin/env python %s create_files -f 10 " "--fixed-file-size 1M %s/%s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_dir, dir_name)) ret, _, _ = g.run(client, cmd) diff --git a/tests/functional/quota/test_quota_rebalance.py b/tests/functional/quota/test_quota_rebalance.py index 5dd53f1f0..8f71ef9c9 100755 --- a/tests/functional/quota/test_quota_rebalance.py +++ b/tests/functional/quota/test_quota_rebalance.py @@ -14,7 +14,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import sys from time import sleep from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on @@ -127,10 +126,9 @@ class TestQuotaRebalance(GlusterBaseClass): # Do some IO until hard limit is reached cmd = ( - "/usr/bin/env python%d %s create_files " + "/usr/bin/env python %s create_files " "-f 100 --fixed-file-size 1M --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) @@ -184,10 +182,9 @@ class TestQuotaRebalance(GlusterBaseClass): # Perform some more IO and check if hard limit is honoured self.all_mounts_procs = [] cmd = ( - "/usr/bin/env python%d %s create_files " + "/usr/bin/env python %s create_files " "-f 100 --fixed-file-size 1M --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) diff --git a/tests/functional/quota/test_quota_rebalance_heal.py b/tests/functional/quota/test_quota_rebalance_heal.py index e8d8f526f..e6feb123d 100644 --- a/tests/functional/quota/test_quota_rebalance_heal.py +++ b/tests/functional/quota/test_quota_rebalance_heal.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2018 Red Hat, Inc. +# Copyright (C) 2015-2020 Red Hat, Inc. # # 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 @@ -14,7 +14,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import sys from time import sleep from glusto.core import Glusto as g @@ -124,9 +123,9 @@ class TestQuotaRebalanceHeal(GlusterBaseClass): for mount_object in self.mounts: g.log.info("Creating Directories on %s:%s", mount_object.client_system, mount_object.mountpoint) - cmd = ("/usr/bin/env python%d %s create_deep_dirs_with_files -d 0 " + cmd = ("/usr/bin/env python %s create_deep_dirs_with_files -d 0 " "-f 1024 -l 4 --fixed-file-size 1k %s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_object.mountpoint)) proc = g.run_async(mount_object.client_system, cmd, @@ -184,9 +183,9 @@ class TestQuotaRebalanceHeal(GlusterBaseClass): # Do some more IO and check if hard limit is honoured all_mounts_procs = [] for mount_object in self.mounts: - cmd = ("/usr/bin/env python%d %s create_files " + cmd = ("/usr/bin/env python %s create_files " "-f 100 --base-file-name file %s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_object.mountpoint)) proc = g.run_async(mount_object.client_system, cmd, user=mount_object.user) diff --git a/tests/functional/quota/test_quota_single_brick_volume.py b/tests/functional/quota/test_quota_single_brick_volume.py index 6e43e2483..33537a115 100644 --- a/tests/functional/quota/test_quota_single_brick_volume.py +++ b/tests/functional/quota/test_quota_single_brick_volume.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 Red Hat, Inc. +# Copyright (C) 2017-2020 Red Hat, Inc. # # 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 @@ -14,8 +14,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import sys - from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, @@ -122,13 +120,13 @@ class QuotaListPathValues(GlusterBaseClass): for mount_obj in self.mounts: g.log.info("Starting IO on %s:%s", mount_obj.client_system, mount_obj.mountpoint) - cmd = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + cmd = ("/usr/bin/env python %s create_deep_dirs_with_files " "--dirname-start-num %d " "--dir-depth 2 " "--dir-length 20 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) -- cgit