diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-12 16:17:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-12 16:17:33 +0000 |
commit | 2a286049b340801cff37329921f2ecca8a33c3fa (patch) | |
tree | a0ea69875c45adc054b2ced6daa71a2e9afdda5b /yardstick/tests | |
parent | 5e531e1e38da7670a1226aec4c664ef96a77335e (diff) | |
parent | 8da1feb7267f4b04e543b2e2e6590e2de8c31237 (diff) |
Merge "Improve "get_server" function in Kubernetes context"
Diffstat (limited to 'yardstick/tests')
-rw-r--r-- | yardstick/tests/unit/benchmark/contexts/test_kubernetes.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py b/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py index 941d50e82..b070b24a9 100644 --- a/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py +++ b/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py @@ -13,6 +13,7 @@ import unittest from yardstick.benchmark import contexts from yardstick.benchmark.contexts import base from yardstick.benchmark.contexts import kubernetes +from yardstick.common import constants from yardstick.orchestrator import kubernetes as orchestrator_kubernetes @@ -118,8 +119,8 @@ class KubernetesTestCase(unittest.TestCase): mock_get_pod_by_name): class Service(object): def __init__(self): - self.name = 'yardstick' self.node_port = 30000 + self.port = constants.SSH_PORT class Services(object): def __init__(self): @@ -136,8 +137,9 @@ class KubernetesTestCase(unittest.TestCase): mock_get_service_by_name.return_value = Services() mock_get_pod_by_name.return_value = Pod() mock_get_node_ip.return_value = '172.16.10.131' - - self.assertIsNotNone(self.k8s_context._get_server('server')) + server = self.k8s_context._get_server('server_name') + self.assertEqual('server_name', server['name']) + self.assertEqual(30000, server['ssh_port']) @mock.patch.object(kubernetes.KubernetesContext, '_create_rc') def test_create_rcs(self, mock_create_rc): |