diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2015-10-12 07:15:54 +0100 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-10-21 14:02:11 +0000 |
commit | c2971871dd1380b88d58f29211a3e8478aca477a (patch) | |
tree | 043893808caaa962f77757b4d495a7b4ec9b9b3b /tools | |
parent | 3572d56f5733592db30f0df2273fe93e731cba2d (diff) |
Add Pylint to VSPERF commit gate
Initial pylint config file has been created to follow current
code structure and design. A few issues have been fixed, so currently
56 of 67 files have rating 10/10. There are still issues to be fixed,
mainly TODOs/FIXMEs and missing impelentation of abstract class members.
Change-Id: Icf5b12c2150258f8ac657f8d50b47a697d1660a0
JIRA: VSPERF-91
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Reviewed-by: Gene Snider <eugene.snider@huawei.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Tv Rao <tv.rao@freescale.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/load_gen/dummy/dummy.py | 2 | ||||
-rw-r--r-- | tools/load_gen/stress/stress.py | 7 | ||||
-rw-r--r-- | tools/report/report.py | 2 | ||||
-rw-r--r-- | tools/systeminfo.py | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/tools/load_gen/dummy/dummy.py b/tools/load_gen/dummy/dummy.py index 74fc33b7..1ad6c3fd 100644 --- a/tools/load_gen/dummy/dummy.py +++ b/tools/load_gen/dummy/dummy.py @@ -26,6 +26,6 @@ class DummyLoadGen(ILoadGenerator): """Start stress load if it was requested""" pass - def kill(self): + def kill(self, signal='-15', sleep=2): """Kill stress load if it is active""" pass diff --git a/tools/load_gen/stress/stress.py b/tools/load_gen/stress/stress.py index 4a53f2d2..4c69a170 100644 --- a/tools/load_gen/stress/stress.py +++ b/tools/load_gen/stress/stress.py @@ -18,6 +18,7 @@ import logging import subprocess import copy +import time from tools import tasks from tools import systeminfo from tools.load_gen.load_gen import ILoadGenerator @@ -111,13 +112,13 @@ class Stress(ILoadGenerator): if self._running: super(Stress, self).start() - def kill(self): + def kill(self, signal='-15', sleep=2): """ Kill stress load if it is active """ if self._running and self._child and self._child.isalive(): - tasks.run_task(['sudo', 'pkill', self._proc_name], - self._logger) + tasks.run_task(['sudo', 'pkill', signal, self._proc_name], self._logger) + time.sleep(sleep) self._logger.info( 'Log available at %s', self._logfile) diff --git a/tools/report/report.py b/tools/report/report.py index 806aecbc..d51ff47d 100644 --- a/tools/report/report.py +++ b/tools/report/report.py @@ -104,7 +104,7 @@ def generate(input_file, tc_results, tc_stats): 'tests': tests, } - output_text = template.render(template_vars) + output_text = template.render(template_vars) #pylint: disable=no-member with open(output_file, 'w') as file_: file_.write(output_text) logging.info('Test report written to "%s"', output_file) diff --git a/tools/systeminfo.py b/tools/systeminfo.py index 287a74d2..d3e24e5d 100644 --- a/tools/systeminfo.py +++ b/tools/systeminfo.py @@ -146,7 +146,7 @@ def get_pids(proc_names_list): try: pids = subprocess.check_output(['pidof'] + proc_names_list) - except: + except subprocess.CalledProcessError: # such process isn't running return None |