aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/runners/sequence.py
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-05-25 09:19:04 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-05-26 02:16:25 +0000
commitfc6eddef3d27cf51b3f6da3a523080e55c6bfb70 (patch)
treef3fe93a193eec436bd834ce4583b084017ac6b5b /yardstick/benchmark/runners/sequence.py
parentdd42ba3cafb908246da5b90c8bbbc2c7d0beb801 (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/sequence.py')
-rw-r--r--yardstick/benchmark/runners/sequence.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/benchmark/runners/sequence.py b/yardstick/benchmark/runners/sequence.py
index af87c006e..74ff82204 100644
--- a/yardstick/benchmark/runners/sequence.py
+++ b/yardstick/benchmark/runners/sequence.py
@@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
def _worker_process(queue, cls, method_name, scenario_cfg,
- context_cfg, aborted):
+ context_cfg, aborted, output_queue):
sequence = 1
@@ -75,7 +75,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":
@@ -86,6 +86,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)
@@ -137,5 +140,5 @@ class SequenceRunner(base.Runner):
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()