diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-06-26 09:46:24 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-06-29 11:25:17 +0000 |
commit | da62008a0a98cb8793ea42827a7da5e149edd144 (patch) | |
tree | f91e35eabe04ebb8c6618345c0fd1b76c5f37a2c /yardstick/benchmark/core/task.py | |
parent | 1ff9df7e724eb0c981aebd5f5b8aa90db0da292b (diff) |
Call core code directly in the API of run test case
JIRA: YARDSTICK-688
We need to call core code directly in the API of runTestCase.
It would be more stable.
Change-Id: I431a85ded7cd3b20da0462f947c25d91bb99decd
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/benchmark/core/task.py')
-rw-r--r-- | yardstick/benchmark/core/task.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index 478a51f9d..9c6caf03f 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -20,6 +20,8 @@ import time import logging import uuid import errno +import collections + from six.moves import filter from yardstick.benchmark.contexts.base import Context @@ -51,7 +53,8 @@ class Task(object): # pragma: no cover atexit.register(self.atexit_handler) - self.task_id = kwargs.get('task_id', str(uuid.uuid4())) + task_id = getattr(args, 'task_id') + self.task_id = task_id if task_id else str(uuid.uuid4()) check_environment() @@ -133,6 +136,7 @@ class Task(object): # pragma: no cover scenario['task_id'], scenario['tc']) print("Done, exiting") + return result def _init_output_config(self, output_config): output_config.setdefault('DEFAULT', {}) @@ -594,6 +598,9 @@ def print_invalid_header(source_name, args): def parse_task_args(src_name, args): + if isinstance(args, collections.Mapping): + return args + try: kw = args and yaml.safe_load(args) kw = {} if kw is None else kw |