From 17fa26e1f33e5c29b7ed0e205dc85376948c5f92 Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Thu, 20 Feb 2020 00:15:46 +0530 Subject: [Testfix] Remove python version dependency(Part 2) Please refer to commit message of patch [1]. [1] https://review.gluster.org/#/c/glusto-tests/+/24140/ Change-Id: Ic0b3b1333ac7b1ae02f701943d49510e6d46c259 Signed-off-by: kshithijiyer --- .../arbiter/brick_cases/test_brickcases.py | 9 ++++----- .../brick_cases/test_cyclic_brick_kill_list.py | 8 +++----- .../arbiter/brick_cases/test_rmvrf_files.py | 6 ++---- .../test_create_snapshot_and_verify_content.py | 10 ++++------ .../test_data_self_heal_algorithm_diff_default.py | 10 ++++------ ...est_data_self_heal_algorithm_diff_heal_command.py | 10 ++++------ .../test_data_self_heal_algorithm_full_default.py | 10 ++++------ .../arbiter/test_data_self_heal_daemon_off.py | 12 ++++++------ .../arbiter/test_entry_self_heal_heal_command.py | 20 ++++++++------------ ...andling_data_split_brain_of_files_heal_command.py | 6 ++---- .../arbiter/test_mount_point_while_deleting_files.py | 9 ++++----- ...est_no_data_loss_arbiter_vol_after_rename_file.py | 14 ++++++-------- ...test_oom_on_client_heal_is_in_progress_arbiter.py | 6 ++---- .../test_remove_faulty_subvol_and_add_new_subvol.py | 6 ++---- ...est_replacing_all_arbiter_bricks_in_the_volume.py | 12 +++--------- tests/functional/disperse/test_ec_add_brick.py | 11 +++++------ tests/functional/disperse/test_ec_fops.py | 7 +++---- tests/functional/disperse/test_ec_fops_brickdown.py | 12 +++++------- tests/functional/disperse/test_ec_remove_brick.py | 11 +++++------ tests/functional/disperse/test_ec_reset.py | 11 +++++------ ...test_ec_verify_datacorruption_during_full_heal.py | 13 ++++--------- .../functional/disperse/test_ec_verify_full_heal.py | 13 ++++--------- 22 files changed, 89 insertions(+), 137 deletions(-) diff --git a/tests/functional/arbiter/brick_cases/test_brickcases.py b/tests/functional/arbiter/brick_cases/test_brickcases.py index 2b006cb92..766012bd5 100755 --- a/tests/functional/arbiter/brick_cases/test_brickcases.py +++ b/tests/functional/arbiter/brick_cases/test_brickcases.py @@ -16,7 +16,6 @@ """ Test Arbiter Specific Cases""" -import sys from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, runs_on) from glustolibs.gluster.volume_libs import ( @@ -126,10 +125,10 @@ class GlusterArbiterVolumeTypeChangeClass(GlusterBaseClass): self.all_mounts_procs = [] g.log.info("Starting IO on %s:%s", self.mounts[0].client_system, self.mounts[0].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 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.script_upload_path, self.mounts[0].mountpoint)) proc = g.run_async(self.mounts[0].client_system, cmd, user=self.mounts[0].user) @@ -186,10 +185,10 @@ class GlusterArbiterVolumeTypeChangeClass(GlusterBaseClass): self.all_mounts_procs = [] g.log.info("Starting IO on %s:%s", self.mounts[0].client_system, self.mounts[0].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 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.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/arbiter/brick_cases/test_cyclic_brick_kill_list.py b/tests/functional/arbiter/brick_cases/test_cyclic_brick_kill_list.py index cbfdbfa29..642c6f011 100755 --- a/tests/functional/arbiter/brick_cases/test_cyclic_brick_kill_list.py +++ b/tests/functional/arbiter/brick_cases/test_cyclic_brick_kill_list.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,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 import time from glusto.core import Glusto as g @@ -135,14 +134,13 @@ class ListMount(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 " + cmd = ("/usr/bin/env python %s " "--file-sizes-list 1G " "--chunk-sizes-list 128 " "--write-time 900 " "--num-of-files 2 " "--base-file-name test_brick_down_from_client_%s.txt " - "--dir %s " % (sys.version_info.major, - self.script_upload_path, + "--dir %s " % (self.script_upload_path, mount_obj.client_system, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, diff --git a/tests/functional/arbiter/brick_cases/test_rmvrf_files.py b/tests/functional/arbiter/brick_cases/test_rmvrf_files.py index 80bd05b86..9dbaa74fc 100755 --- a/tests/functional/arbiter/brick_cases/test_rmvrf_files.py +++ b/tests/functional/arbiter/brick_cases/test_rmvrf_files.py @@ -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, runs_on) @@ -131,13 +129,13 @@ class TestRmrfMount(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 35 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, self.counter, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) diff --git a/tests/functional/arbiter/test_create_snapshot_and_verify_content.py b/tests/functional/arbiter/test_create_snapshot_and_verify_content.py index c15d379dd..ec7e801f5 100755 --- a/tests/functional/arbiter/test_create_snapshot_and_verify_content.py +++ b/tests/functional/arbiter/test_create_snapshot_and_verify_content.py @@ -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, runs_on) @@ -110,9 +108,9 @@ class TestArbiterSelfHeal(GlusterBaseClass): # Create dirs with file all_mounts_procs = [] g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + command = ("/usr/bin/env python %s create_deep_dirs_with_files " "-d 2 -l 2 -n 2 -f 20 %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, command, user=self.mounts[0].user) @@ -142,9 +140,9 @@ class TestArbiterSelfHeal(GlusterBaseClass): # Create dirs with file all_mounts_procs = [] g.log.info('Adding dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + command = ("/usr/bin/env python %s create_deep_dirs_with_files " "-d 2 -l 2 -n 2 -f 20 %s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, self.mounts[0].mountpoint+'/new_files')) proc = g.run_async(self.mounts[0].client_system, command, user=self.mounts[0].user) diff --git a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_default.py b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_default.py index def1f7cd2..17c2ba4d5 100644 --- a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_default.py +++ b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_default.py @@ -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, runs_on) @@ -118,8 +116,8 @@ class TestSelfHeal(GlusterBaseClass): g.log.info("Generating data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) # Creating files - command = "/usr/bin/env python%d %s create_files -f 100 %s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s create_files -f 100 %s" % ( + self.script_upload_path, self.mounts[0].mountpoint) proc = g.run_async(self.mounts[0].client_system, command, @@ -157,9 +155,9 @@ class TestSelfHeal(GlusterBaseClass): all_mounts_procs = [] g.log.info("Modifying data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - command = ("/usr/bin/env python%d %s create_files -f 100 " + command = ("/usr/bin/env python %s create_files -f 100 " "--fixed-file-size 1M %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, command, diff --git a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py index 4f4065d8e..132b9df8a 100755 --- a/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py +++ b/tests/functional/arbiter/test_data_self_heal_algorithm_diff_heal_command.py @@ -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, runs_on) @@ -139,8 +137,8 @@ class TestSelfHeal(GlusterBaseClass): g.log.info("Generating data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) # Creating files - command = "/usr/bin/env python%d %s create_files -f 100 %s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s create_files -f 100 %s" % ( + self.script_upload_path, self.mounts[0].mountpoint) proc = g.run_async(self.mounts[0].client_system, command, @@ -185,9 +183,9 @@ class TestSelfHeal(GlusterBaseClass): all_mounts_procs = [] g.log.info("Modifying data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - command = ("/usr/bin/env python%d %s create_files -f 100 " + command = ("/usr/bin/env python %s create_files -f 100 " "--fixed-file-size 1M %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, command, diff --git a/tests/functional/arbiter/test_data_self_heal_algorithm_full_default.py b/tests/functional/arbiter/test_data_self_heal_algorithm_full_default.py index 4ab220351..82538d42a 100755 --- a/tests/functional/arbiter/test_data_self_heal_algorithm_full_default.py +++ b/tests/functional/arbiter/test_data_self_heal_algorithm_full_default.py @@ -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, runs_on) @@ -117,8 +115,8 @@ class TestSelfHeal(GlusterBaseClass): g.log.info("Generating data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) # Creating files - command = "/usr/bin/env python%d %s create_files -f 100 %s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s create_files -f 100 %s" % ( + self.script_upload_path, self.mounts[0].mountpoint) proc = g.run_async(self.mounts[0].client_system, command, @@ -156,9 +154,9 @@ class TestSelfHeal(GlusterBaseClass): all_mounts_procs = [] g.log.info("Modifying data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - command = ("/usr/bin/env python%d %s create_files -f 100 " + command = ("/usr/bin/env python %s create_files -f 100 " "--fixed-file-size 1M %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, command, diff --git a/tests/functional/arbiter/test_data_self_heal_daemon_off.py b/tests/functional/arbiter/test_data_self_heal_daemon_off.py index 7f23c7c07..df2e58aa6 100644 --- a/tests/functional/arbiter/test_data_self_heal_daemon_off.py +++ b/tests/functional/arbiter/test_data_self_heal_daemon_off.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) @@ -136,9 +135,9 @@ class TestSelfHeal(GlusterBaseClass): # Creating files on client side g.log.info("Starting IO on %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - cmd = ("/usr/bin/env python%d %s create_files -f 100" + cmd = ("/usr/bin/env python %s create_files -f 100" " --fixed-file-size 1k %s" - % (sys.version_info.major, self.script_upload_path, + % (self.script_upload_path, self.mounts[0].mountpoint)) ret, _, err = g.run(self.mounts[0].client_system, cmd, user=self.mounts[0].user) @@ -202,9 +201,9 @@ class TestSelfHeal(GlusterBaseClass): # Modify the data g.log.info("Modifying data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - cmd = ("/usr/bin/env python%d %s create_files -f 100" + cmd = ("/usr/bin/env python %s create_files -f 100" " --fixed-file-size 10k %s" - % (sys.version_info.major, self.script_upload_path, + % (self.script_upload_path, self.mounts[0].mountpoint)) ret, _, err = g.run(self.mounts[0].client_system, cmd, user=self.mounts[0].user) @@ -290,7 +289,8 @@ class TestSelfHeal(GlusterBaseClass): all_mounts_procs = [] g.log.info("Modifying data for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - command = ("python %s create_files -f 1000 --base-file-name newfile %s" + command = ("/usr/bin/env python %s create_files -f 1000" + " --base-file-name newfile %s" % (self.script_upload_path, self.mounts[0].mountpoint)) proc = g.run_async(self.mounts[0].client_system, command, diff --git a/tests/functional/arbiter/test_entry_self_heal_heal_command.py b/tests/functional/arbiter/test_entry_self_heal_heal_command.py index a268fb6eb..ced2bc19c 100644 --- a/tests/functional/arbiter/test_entry_self_heal_heal_command.py +++ b/tests/functional/arbiter/test_entry_self_heal_heal_command.py @@ -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, runs_on) @@ -136,12 +134,12 @@ class TestSelfHeal(GlusterBaseClass): g.log.info("Starting IO on all mounts...") g.log.info("Starting IO on %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - cmd = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + cmd = ("/usr/bin/env python %s create_deep_dirs_with_files " "--dir-length 2 " "--dir-depth 2 " "--max-num-of-dirs 2 " "--num-of-files 20 %s/files" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, self.mounts[0].mountpoint)) ret, _, err = g.run(self.mounts[0].client_system, cmd, user=self.mounts[0].user) @@ -153,11 +151,11 @@ class TestSelfHeal(GlusterBaseClass): # Command list to do different operations with data - # create, rename, copy and delete cmds = ( - "/usr/bin/env python%d %s create_files -f 20 %s/files", - "/usr/bin/env python%d %s mv %s/files", + "/usr/bin/env python %s create_files -f 20 %s/files", + "/usr/bin/env python %s mv %s/files", # 'copy' command works incorrect. disable until fixed - # "/usr/bin/env python%d %s copy --dest-dir %s/new_dir %s/files", - "/usr/bin/env python%d %s delete %s", + # "/usr/bin/env python %s copy --dest-dir %s/new_dir %s/files", + "/usr/bin/env python %s delete %s", ) for cmd in cmds: # Get arequal before getting bricks offline @@ -218,13 +216,11 @@ class TestSelfHeal(GlusterBaseClass): g.log.info("Modifying IO on %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) if 'copy --dest-dir' in cmd: - parsed_cmd = cmd % (sys.version_info.major, - self.script_upload_path, + parsed_cmd = cmd % (self.script_upload_path, self.mounts[0].mountpoint, self.mounts[0].mountpoint) else: - parsed_cmd = cmd % (sys.version_info.major, - self.script_upload_path, + parsed_cmd = cmd % (self.script_upload_path, self.mounts[0].mountpoint) ret, _, err = g.run(self.mounts[0].client_system, parsed_cmd, user=self.mounts[0].user) diff --git a/tests/functional/arbiter/test_handling_data_split_brain_of_files_heal_command.py b/tests/functional/arbiter/test_handling_data_split_brain_of_files_heal_command.py index 23bd40598..1cb4f2c49 100755 --- a/tests/functional/arbiter/test_handling_data_split_brain_of_files_heal_command.py +++ b/tests/functional/arbiter/test_handling_data_split_brain_of_files_heal_command.py @@ -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, runs_on) @@ -315,8 +313,8 @@ class TestArbiterSelfHeal(GlusterBaseClass): for mount_obj in self.mounts: g.log.info("Start heal for %s:%s", mount_obj.client_system, mount_obj.mountpoint) - command = "/usr/bin/env python%d %s read %s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s read %s" % ( + self.script_upload_path, self.mounts[0].mountpoint) ret, _, err = g.run(mount_obj.client_system, command) self.assertFalse(ret, err) diff --git a/tests/functional/arbiter/test_mount_point_while_deleting_files.py b/tests/functional/arbiter/test_mount_point_while_deleting_files.py index 520cb7e61..6acb8e0c8 100755 --- a/tests/functional/arbiter/test_mount_point_while_deleting_files.py +++ b/tests/functional/arbiter/test_mount_point_while_deleting_files.py @@ -15,7 +15,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import os -import sys from glusto.core import Glusto as g @@ -198,11 +197,11 @@ class VolumeSetDataSelfHealTests(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create files g.log.info('Creating files...') - command = ("/usr/bin/env python%d %s create_files " + command = ("/usr/bin/env python %s create_files " "-f 100 " "--fixed-file-size 1M " "%s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, @@ -241,8 +240,8 @@ class VolumeSetDataSelfHealTests(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Delete files g.log.info('Deleting files...') - command = "/usr/bin/env python%d %s delete %s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s delete %s" % ( + self.script_upload_path, mount_obj.mountpoint) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) diff --git a/tests/functional/arbiter/test_no_data_loss_arbiter_vol_after_rename_file.py b/tests/functional/arbiter/test_no_data_loss_arbiter_vol_after_rename_file.py index 981e9cde3..4f30249d0 100755 --- a/tests/functional/arbiter/test_no_data_loss_arbiter_vol_after_rename_file.py +++ b/tests/functional/arbiter/test_no_data_loss_arbiter_vol_after_rename_file.py @@ -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, runs_on) @@ -131,9 +129,9 @@ class ArbiterSelfHealTests(GlusterBaseClass): self.mounts[0].client_system, self.mounts[0].mountpoint) # Create dir g.log.info('Creating dir...') - command = ('/usr/bin/env python%d %s create_deep_dir -d 1 -l 0 -n 1 ' + command = ('/usr/bin/env python %s create_deep_dir -d 1 -l 0 -n 1 ' '%s/%s' % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, self.mounts[0].mountpoint, test_dir)) ret, _, err = g.run(self.mounts[0].client_system, command, @@ -166,8 +164,8 @@ class ArbiterSelfHealTests(GlusterBaseClass): self.mounts[0].client_system, self.mounts[0].mountpoint) # Create file g.log.info('Creating file...') - command = "/usr/bin/env python%d %s create_files -f 1 %s/%s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s create_files -f 1 %s/%s" % ( + self.script_upload_path, self.mounts[0].mountpoint, test_dir) ret, _, err = g.run(self.mounts[0].client_system, command, @@ -214,8 +212,8 @@ class ArbiterSelfHealTests(GlusterBaseClass): # Rename file under test_dir g.log.info("Renaming file for %s:%s", self.mounts[0].client_system, self.mounts[0].mountpoint) - command = "/usr/bin/env python%d %s mv %s/%s" % ( - sys.version_info.major, self.script_upload_path, + command = "/usr/bin/env python %s mv %s/%s" % ( + self.script_upload_path, self.mounts[0].mountpoint, test_dir) ret, _, err = g.run(self.mounts[0].client_system, command) self.assertEqual(ret, 0, err) diff --git a/tests/functional/arbiter/test_oom_on_client_heal_is_in_progress_arbiter.py b/tests/functional/arbiter/test_oom_on_client_heal_is_in_progress_arbiter.py index 55458690e..00988386b 100755 --- a/tests/functional/arbiter/test_oom_on_client_heal_is_in_progress_arbiter.py +++ b/tests/functional/arbiter/test_oom_on_client_heal_is_in_progress_arbiter.py @@ -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, runs_on) @@ -120,11 +118,11 @@ class ArbiterSelfHealTests(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create files g.log.info('Creating files...') - command = ("/usr/bin/env python%d %s create_files " + command = ("/usr/bin/env python %s create_files " "-f 1000 " "--fixed-file-size 10k " "%s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, diff --git a/tests/functional/arbiter/test_remove_faulty_subvol_and_add_new_subvol.py b/tests/functional/arbiter/test_remove_faulty_subvol_and_add_new_subvol.py index 2c0490b9f..06b494e9b 100644 --- a/tests/functional/arbiter/test_remove_faulty_subvol_and_add_new_subvol.py +++ b/tests/functional/arbiter/test_remove_faulty_subvol_and_add_new_subvol.py @@ -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, runs_on) @@ -120,13 +118,13 @@ class TestArbiterSelfHeal(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + command = ("/usr/bin/env python %s create_deep_dirs_with_files " "-d 2 " "-l 2 " "-n 2 " "-f 20 " "%s" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, diff --git a/tests/functional/arbiter/test_replacing_all_arbiter_bricks_in_the_volume.py b/tests/functional/arbiter/test_replacing_all_arbiter_bricks_in_the_volume.py index b95a977a0..26c848171 100755 --- a/tests/functional/arbiter/test_replacing_all_arbiter_bricks_in_the_volume.py +++ b/tests/functional/arbiter/test_replacing_all_arbiter_bricks_in_the_volume.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 glusto.core import Glusto as g @@ -147,14 +146,9 @@ class TestArbiterSelfHeal(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " - "-d 3 " - "-l 3 " - "-n 3 " - "-f 20 " - "%s" % ( - sys.version_info.major, self.script_upload_path, - mount_obj.mountpoint)) + command = ("/usr/bin/env python %s create_deep_dirs_with_files " + "-d 3 -l 3 -n 3 -f 20 %s" + % (self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_add_brick.py b/tests/functional/disperse/test_ec_add_brick.py index 09b729c2f..27571e36e 100644 --- a/tests/functional/disperse/test_ec_add_brick.py +++ b/tests/functional/disperse/test_ec_add_brick.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 @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License along # 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 @@ -83,13 +82,13 @@ class DispersedWithAddBrick(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) @@ -150,13 +149,13 @@ class DispersedWithAddBrick(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_fops.py b/tests/functional/disperse/test_ec_fops.py index a9339581e..53583f37e 100644 --- a/tests/functional/disperse/test_ec_fops.py +++ b/tests/functional/disperse/test_ec_fops.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Red Hat, Inc. +# Copyright (C) 2019-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 @@ -19,7 +19,6 @@ Test Description: Tests File Operations on a healthy EC volume """ from os import getcwd -import sys from glusto.core import Glusto as g @@ -250,13 +249,13 @@ class TestFops(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_fops_brickdown.py b/tests/functional/disperse/test_ec_fops_brickdown.py index f7cac1fcf..906714456 100644 --- a/tests/functional/disperse/test_ec_fops_brickdown.py +++ b/tests/functional/disperse/test_ec_fops_brickdown.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Red Hat, Inc. +# Copyright (C) 2019-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 @@ -20,8 +20,6 @@ Test Description: brought down """ -import sys - from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import (GlusterBaseClass, runs_on) @@ -265,13 +263,13 @@ class TestFopsBrickdown(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s/dir1" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) @@ -304,13 +302,13 @@ class TestFopsBrickdown(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s/dir2" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_remove_brick.py b/tests/functional/disperse/test_ec_remove_brick.py index a5422f269..a41f78c95 100644 --- a/tests/functional/disperse/test_ec_remove_brick.py +++ b/tests/functional/disperse/test_ec_remove_brick.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 @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License along # 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 @@ -81,13 +80,13 @@ class DispersedWithAddBrick(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) @@ -130,13 +129,13 @@ class DispersedWithAddBrick(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 10 " "--max-num-of-dirs 5 " "--num-of-files 5 %s" % ( - sys.version_info.major, self.script_upload_path, count, + self.script_upload_path, count, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user) diff --git a/tests/functional/disperse/test_ec_reset.py b/tests/functional/disperse/test_ec_reset.py index 6b115ccb4..4b797a055 100644 --- a/tests/functional/disperse/test_ec_reset.py +++ b/tests/functional/disperse/test_ec_reset.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Red Hat, Inc. +# Copyright (C) 2018-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 @@ -22,7 +22,6 @@ Test Description: """ from os import getcwd from random import choice -import sys from time import sleep from glusto.core import Glusto as g @@ -168,9 +167,9 @@ class TestBrickReset(GlusterBaseClass): # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + command = ("/usr/bin/env python %s create_deep_dirs_with_files " "-d 2 -l 2 -n 2 -f 20 %s/dir2" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, @@ -341,9 +340,9 @@ class TestBrickReset(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " + command = ("/usr/bin/env python %s create_deep_dirs_with_files " "-d 2 -l 2 -n 2 -f 20 %s/dir1" % ( - sys.version_info.major, self.script_upload_path, + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, diff --git a/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py b/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py index 42f742144..6d91ee0c6 100644 --- a/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py +++ b/tests/functional/disperse/test_ec_verify_datacorruption_during_full_heal.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2019 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 @@ -123,13 +122,9 @@ class TestHealFullNodeReboot(GlusterBaseClass): # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " - "-d 2 " - "-l 2 " - "-n 2 " - "-f 20 " - "%s" % ( - sys.version_info.major, self.script_upload_path, + command = ("/usr/bin/env python %s create_deep_dirs_with_files " + "-d 2 -l 2 -n 2 -f 20 %s" % ( + self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, diff --git a/tests/functional/disperse/test_ec_verify_full_heal.py b/tests/functional/disperse/test_ec_verify_full_heal.py index 1ae873841..3051076f9 100644 --- a/tests/functional/disperse/test_ec_verify_full_heal.py +++ b/tests/functional/disperse/test_ec_verify_full_heal.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2016 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 @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License along # 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 @@ -120,13 +119,9 @@ class TestHealFull(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create dirs with file g.log.info('Creating dirs with file...') - command = ("/usr/bin/env python%d %s create_deep_dirs_with_files " - "-d 2 " - "-l 2 " - "-n 2 " - "-f 20 " - "%s" - % (sys.version_info.major, self.script_upload_path, + command = ("/usr/bin/env python %s create_deep_dirs_with_files " + "-d 2 -l 2 -n 2 -f 20 %s" + % (self.script_upload_path, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, -- cgit