diff options
author | 2017-08-30 02:31:40 +0000 | |
---|---|---|
committer | 2017-09-25 08:30:21 -0700 | |
commit | 86c0326342b33f6e0b090b973fb58831ed1d38d2 (patch) | |
tree | f7e15ee3417040f214a496d80d6953087d42f567 /yardstick/benchmark/core | |
parent | c793405a28a3b26845c379e3f4b60deab026d76d (diff) |
Add service in kubernetes context
JIRA: YARDSTICK-803
Currently kubernetes test case can only run in master node.
We need to support it run in jump server.
So I add service and use nodePort type.
Then we can login the pod using nodePort.
Change-Id: Ia7900d263f1c5323f132435addec27ad10547ef9
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/benchmark/core')
-rw-r--r-- | yardstick/benchmark/core/task.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index 932d909a6..7e071bc0e 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -336,7 +336,7 @@ class Task(object): # pragma: no cover context_cfg['target'] = {"ipaddr": target} else: context_cfg['target'] = Context.get_server(target) - if self._is_same_heat_context(cfg["host"], target): + if self._is_same_context(cfg["host"], target): context_cfg['target']["ipaddr"] = context_cfg['target']["private_ip"] else: context_cfg['target']["ipaddr"] = context_cfg['target']["ip"] @@ -361,8 +361,8 @@ class Task(object): # pragma: no cover context_cfg['target'] = {} else: context_cfg['target'] = Context.get_server(target) - if self._is_same_heat_context(scenario_cfg["host"], - target): + if self._is_same_context(scenario_cfg["host"], + target): ip_list.append(context_cfg["target"]["private_ip"]) else: ip_list.append(context_cfg["target"]["ip"]) @@ -380,7 +380,7 @@ class Task(object): # pragma: no cover return runner - def _is_same_heat_context(self, host_attr, target_attr): + def _is_same_context(self, host_attr, target_attr): """check if two servers are in the same heat context host_attr: either a name for a server created by yardstick or a dict with attribute name mapping when using external heat templates @@ -388,7 +388,7 @@ class Task(object): # pragma: no cover with attribute name mapping when using external heat templates """ for context in self.contexts: - if context.__context_type__ != "Heat": + if context.__context_type__ not in {"Heat", "Kubernetes"}: continue host = context._get_server(host_attr) |