From 1821490ff915bcc2a575b8cda9da84d57be595af Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Thu, 19 Dec 2019 11:46:34 +0530 Subject: [Fix] Remove variable script_local_path(Part 1) Removing script_local_path as both script_local_path and cls.script_upload_path hold the same values which makes each script slow. This will help decrease the execution time of the test suite. PoC: $cat test.py a = ("/usr/share/glustolibs/io/scripts/" "file_dir_ops.py") b = ("/usr/share/glustolibs/io/scripts/" "file_dir_ops.py") $time python test.py real 0m0.063s user 0m0.039s sys 0m0.019s $cat test.py a = ("/usr/share/glustolibs/io/scripts/" "file_dir_ops.py") $time python test.py real 0m0.013s user 0m0.009s sys 0m0.003s Code changes needed: From: 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) To: cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/" "file_dir_ops.py") ret = upload_scripts(cls.clients, cls.script_upload_path) Change-Id: I7908b3b418bbc929b7cc3ff81e3675310eecdbeb Signed-off-by: kshithijiyer --- tests/functional/quota/test_limit_usage_deep_dir.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/functional/quota/test_limit_usage_deep_dir.py') diff --git a/tests/functional/quota/test_limit_usage_deep_dir.py b/tests/functional/quota/test_limit_usage_deep_dir.py index 96cdd1490..092bac416 100644 --- a/tests/functional/quota/test_limit_usage_deep_dir.py +++ b/tests/functional/quota/test_limit_usage_deep_dir.py @@ -46,11 +46,9 @@ class LimitUsageDeepDir(GlusterBaseClass): # 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) -- cgit