diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-10 09:23:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-10 09:23:29 +0000 |
commit | 9e3cf5cb7b638c02419d34a3bbe890a6d82cd80c (patch) | |
tree | e252edb85c922a3af23500f39cdd7b04cbfd991c /yardstick/tests | |
parent | 9fc8dd0d24489c8362ab3b20f0e62888e896c283 (diff) | |
parent | b5cafe95acef8a14def98192b6de96b92b574cef (diff) |
Merge "Add "resources" parameter in Kubernetes context"
Diffstat (limited to 'yardstick/tests')
-rw-r--r-- | yardstick/tests/unit/orchestrator/test_kubernetes.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/yardstick/tests/unit/orchestrator/test_kubernetes.py b/yardstick/tests/unit/orchestrator/test_kubernetes.py index 5eba1a02a..2451518a4 100644 --- a/yardstick/tests/unit/orchestrator/test_kubernetes.py +++ b/yardstick/tests/unit/orchestrator/test_kubernetes.py @@ -302,6 +302,24 @@ class ContainerObjectTestCase(base.BaseUnitTestCase): 'value': 'fake_var_value'}]} self.assertEqual(expected, container_obj.get_container_item()) + def test_get_container_item_with_resources(self): + volume_mount = {'name': 'fake_name', + 'mountPath': 'fake_path'} + args = ['arg1', 'arg2'] + resources = {'requests': {'key1': 'val1'}, + 'limits': {'key2': 'val2'}, + 'other_key': {'key3': 'val3'}} + container_obj = kubernetes.ContainerObject( + 'cname', ssh_key='fake_sshkey', volumeMount=[volume_mount], + args=args, resources=resources) + expected = {'args': args, + 'command': [kubernetes.ContainerObject.COMMAND_DEFAULT], + 'image': kubernetes.ContainerObject.IMAGE_DEFAULT, + 'name': 'cname-container', + 'volumeMounts': container_obj._create_volume_mounts(), + 'resources': {'requests': {'key1': 'val1'}, + 'limits': {'key2': 'val2'}}} + self.assertEqual(expected, container_obj.get_container_item()) class CustomResourceDefinitionObjectTestCase(base.BaseUnitTestCase): |