aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/core
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-06-05 01:20:33 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-05 01:20:33 +0000
commit0e1b3483f1514177b61a645abda906b68b13bd36 (patch)
tree970946925fc14ba0ac36bccf9fd816ebc5e39fcd /tests/unit/benchmark/core
parent28a97ee05186295b7d71f449ac703bf78e5fd358 (diff)
parentfc6eddef3d27cf51b3f6da3a523080e55c6bfb70 (diff)
Merge "Pass parameters between scenarios"
Diffstat (limited to 'tests/unit/benchmark/core')
-rw-r--r--tests/unit/benchmark/core/test_task.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/benchmark/core/test_task.py b/tests/unit/benchmark/core/test_task.py
index cd7ffdebb..8034392f4 100644
--- a/tests/unit/benchmark/core/test_task.py
+++ b/tests/unit/benchmark/core/test_task.py
@@ -64,6 +64,7 @@ class TaskTestCase(unittest.TestCase):
t = task.Task()
runner = mock.Mock()
runner.join.return_value = 0
+ runner.get_output.return_value = {}
mock_base_runner.Runner.get.return_value = runner
t._run([scenario], False, "yardstick.out")
self.assertTrue(runner.run.called)
@@ -155,6 +156,33 @@ class TaskTestCase(unittest.TestCase):
self.assertEqual(task_args_fnames[0], None)
self.assertEqual(task_args_fnames[1], None)
+ def test_parse_options(self):
+ options = {
+ 'openstack': {
+ 'EXTERNAL_NETWORK': '$network'
+ },
+ 'ndoes': ['node1', '$node'],
+ 'host': '$host'
+ }
+
+ t = task.Task()
+ t.outputs = {
+ 'network': 'ext-net',
+ 'node': 'node2',
+ 'host': 'server.yardstick'
+ }
+
+ idle_result = {
+ 'openstack': {
+ 'EXTERNAL_NETWORK': 'ext-net'
+ },
+ 'ndoes': ['node1', 'node2'],
+ 'host': 'server.yardstick'
+ }
+
+ actual_result = t._parse_options(options)
+ self.assertEqual(idle_result, actual_result)
+
def test_change_server_name_host_str(self):
scenario = {'host': 'demo'}
suffix = '-8'