diff options
| author | kshithijiyer <kshithij.ki@gmail.com> | 2019-12-19 11:46:34 +0530 | 
|---|---|---|
| committer | Bala Konda Reddy M <bmekala@redhat.com> | 2020-01-07 12:11:31 +0000 | 
| commit | 1821490ff915bcc2a575b8cda9da84d57be595af (patch) | |
| tree | 2f3f77e7cc1a718ac71a919b6d5326b43d07834c /tests/functional/samba | |
| parent | d131ce9f70c528cdd50aa0d4f2923f5a9f14aefc (diff) | |
[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 <kshithij.ki@gmail.com>
Diffstat (limited to 'tests/functional/samba')
| -rw-r--r-- | tests/functional/samba/test_stat_prefetch.py | 4 | 
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/functional/samba/test_stat_prefetch.py b/tests/functional/samba/test_stat_prefetch.py index ac3e6a674..d7d4e90fe 100644 --- a/tests/functional/samba/test_stat_prefetch.py +++ b/tests/functional/samba/test_stat_prefetch.py @@ -57,11 +57,9 @@ class TestValidateCifs(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)  | 
