summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 11:39:06 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 11:39:06 +0800
commit859500cd62ec16090c808c877aa222d8aafa5fe3 (patch)
treef92a74e2d0edfebcce79fa1299600ca7de1e571a
parent09e41a54625caa2f713798e869e5e1e5a31c0d58 (diff)
Add test_get_hpa_dpdk
Add test_get_hpa_dpdk Change-Id: I84ed1380b0870ab9beb24320b826ce9bb75e2dfc Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r--vio/vio/tests/test_aai_client.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/vio/vio/tests/test_aai_client.py b/vio/vio/tests/test_aai_client.py
index 17a0047..fa83d5d 100644
--- a/vio/vio/tests/test_aai_client.py
+++ b/vio/vio/tests/test_aai_client.py
@@ -10,6 +10,7 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import json
import mock
import unittest
@@ -365,3 +366,13 @@ class TestAAIClient(unittest.TestCase):
}
ret = self.view._get_pci_passthrough_capabilities(extra)
self.assertEqual(3, len(ret["hpa-feature-attributes"]))
+
+ @mock.patch.object(restcall, "call_req")
+ def test_get_hpa_dpdk(self, mock_call):
+ self.view.get_vim = mock.MagicMock()
+ self.view.get_vim.return_value = {
+ "cloud-extra-info": json.dumps({'ovsDpdk': {
+ 'libname': 'generic', 'libversion': '17.04'}})
+ }
+ ret = self.view._get_ovsdpdk_capabilities()
+ self.assertEqual(1, len(ret["hpa-feature-attributes"]))