summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-07-04 03:08:33 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-04 03:08:33 +0000
commitd3d4d6d1daeae08f5bc162a4a1a6d1d90eb7e53e (patch)
tree0a02682d3c62ca70789895653583a67d69bb07a9 /vio
parent8d59d11e80d68103177ba77c251b02ecf9de9543 (diff)
parent859500cd62ec16090c808c877aa222d8aafa5fe3 (diff)
Merge "Add test_get_hpa_dpdk"
Diffstat (limited to 'vio')
-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"]))