summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 10:57:41 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 10:57:41 +0800
commit6081d6d12ced1304503068460f6063d2006f281b (patch)
tree6a2226671d884ae728e01434798d9c7830da62ce /vio
parent868b1e95fdaaefc0236443defc0d24276daf132f (diff)
Add test_get_hpa
Add test_get_hpa Change-Id: I0a642fed7fa05a853483578c4ac77dcb41114fe2 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_aai_client.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/vio/vio/tests/test_aai_client.py b/vio/vio/tests/test_aai_client.py
index f4dbed4..d2b7633 100644
--- a/vio/vio/tests/test_aai_client.py
+++ b/vio/vio/tests/test_aai_client.py
@@ -243,3 +243,28 @@ class TestAAIClient(unittest.TestCase):
}
self.view.update_vim(content)
mock_call.assert_called_once()
+
+ @mock.patch.object(restcall, "call_req")
+ def test_get_hpa(self, mock_call):
+ self.view._get_hpa_basic_capabilities = mock.MagicMock()
+ self.view._get_hpa_basic_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_cpupinning_capabilities = mock.MagicMock()
+ self.view._get_cpupinning_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_cputopology_capabilities = mock.MagicMock()
+ self.view._get_cputopology_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_hugepages_capabilities = mock.MagicMock()
+ self.view._get_hugepages_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_numa_capabilities = mock.MagicMock()
+ self.view._get_numa_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_storage_capabilities = mock.MagicMock()
+ self.view._get_storage_capabilities.return_value = {"hpa": "basic"}
+ self.view._get_instruction_set_capabilities = mock.MagicMock()
+ self.view._get_instruction_set_capabilities.return_value = {
+ "hpa": "basic"}
+ self.view._get_pci_passthrough_capabilities = mock.MagicMock()
+ self.view._get_pci_passthrough_capabilities.return_value = {
+ "hpa": "basic"}
+ self.view._get_ovsdpdk_capabilities = mock.MagicMock()
+ self.view._get_ovsdpdk_capabilities.return_value = {"hpa": "basic"}
+ ret = self.view._get_hpa_capabilities({"extra_specs": {}})
+ self.assertEqual([{"hpa": "basic"}]*9, ret)