diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-05-25 09:19:04 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-05-26 02:16:25 +0000 |
commit | fc6eddef3d27cf51b3f6da3a523080e55c6bfb70 (patch) | |
tree | f3fe93a193eec436bd834ce4583b084017ac6b5b /yardstick/benchmark/runners/duration.py | |
parent | dd42ba3cafb908246da5b90c8bbbc2c7d0beb801 (diff) |
Pass parameters between scenarios
JIRA: YARDSTICK-641
Allowing parameters to pass between scenarios so that the one test case
can be combination of several scenarios.
Change-Id: I55a00855e77d5b719a27a069a3ea195d6bbd0ef8
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/benchmark/runners/duration.py')
-rw-r--r-- | yardstick/benchmark/runners/duration.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/benchmark/runners/duration.py b/yardstick/benchmark/runners/duration.py index 772983cfd..2bf2cd2fe 100644 --- a/yardstick/benchmark/runners/duration.py +++ b/yardstick/benchmark/runners/duration.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) def _worker_process(queue, cls, method_name, scenario_cfg, - context_cfg, aborted): + context_cfg, aborted, output_queue): sequence = 1 @@ -66,7 +66,7 @@ def _worker_process(queue, cls, method_name, scenario_cfg, errors = "" try: - method(data) + result = method(data) except AssertionError as assertion: # SLA validation failed in scenario, determine what to do now if sla_action == "assert": @@ -77,6 +77,9 @@ def _worker_process(queue, cls, method_name, scenario_cfg, except Exception as e: errors = traceback.format_exc() LOG.exception(e) + else: + if result: + output_queue.put(result) time.sleep(interval) @@ -126,5 +129,5 @@ If the scenario ends before the time has elapsed, it will be started again. self.process = multiprocessing.Process( target=_worker_process, args=(self.result_queue, cls, method, scenario_cfg, - context_cfg, self.aborted)) + context_cfg, self.aborted, self.output_queue)) self.process.start() |