diff options
author | treyad <treyad@viosoft.com> | 2018-10-16 10:50:12 -0700 |
---|---|---|
committer | treyad <treyad@viosoft.com> | 2019-04-04 04:04:21 -0700 |
commit | 489a6064839920121866f8fb3d3a86ab86e5e663 (patch) | |
tree | 5f622b6c1992a17feca6e6e04c71d431d260bbc9 /yardstick/tests/unit/benchmark/core | |
parent | 8db9e58a32ef06737faf98757a123cc8e5e02c28 (diff) |
Update to support using external heat template
Modify the _get_server() function when using external heat template.
The server attrs should be read from stack.outputs.
JIRA: YARDSTICK-1453
Change-Id: I00eda7476e77fc0a5c15ef8db7d057fa1cf267e6
Signed-off-by: treyad <treyad@viosoft.com>
Diffstat (limited to 'yardstick/tests/unit/benchmark/core')
-rw-r--r-- | yardstick/tests/unit/benchmark/core/test_task.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py index e1414c2ae..1903babf9 100644 --- a/yardstick/tests/unit/benchmark/core/test_task.py +++ b/yardstick/tests/unit/benchmark/core/test_task.py @@ -18,6 +18,7 @@ import six from six.moves import builtins import unittest import uuid +import collections from yardstick.benchmark.contexts import base from yardstick.benchmark.contexts import dummy @@ -487,6 +488,42 @@ key2: self.parser._change_node_names(scenario, [my_context]) self.assertIsNone(scenario['options']['server_name']) + def test__change_node_names_target_map(self): + ctx_attrs = { + 'name': 'demo', + 'task_id': '1234567890' + } + my_context = dummy.DummyContext() + self.addCleanup(self._remove_contexts) + my_context.init(ctx_attrs) + scenario = copy.deepcopy(self.scenario) + scenario['nodes'] = { + 'tg__0': { + 'name': 'tg__0.demo', + 'public_ip_attr': "1.1.1.1", + }, + 'vnf__0': { + 'name': 'vnf__0.demo', + 'public_ip_attr': "2.2.2.2", + } + } + self.parser._change_node_names(scenario, [my_context]) + for target in scenario['nodes'].values(): + self.assertIsInstance(target, collections.Mapping) + + def test__change_node_names_not_target_map(self): + ctx_attrs = { + 'name': 'demo', + 'task_id': '1234567890' + } + my_context = dummy.DummyContext() + self.addCleanup(self._remove_contexts) + my_context.init(ctx_attrs) + scenario = copy.deepcopy(self.scenario) + self.parser._change_node_names(scenario, [my_context]) + for target in scenario['nodes'].values(): + self.assertNotIsInstance(target, collections.Mapping) + def test__parse_tasks(self): task_obj = task.Task() _uuid = uuid.uuid4() |