Merge "Add ODL HA testcase"
[yardstick.git] / tests / unit / network_services / vnf_generic / vnf / test_vpe_vnf.py
index 55cd4d2..8c45d97 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 # Copyright (c) 2016-2017 Intel Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # limitations under the License.
 #
 
-import mock
 from multiprocessing import Process, Queue
 import os
-import six.moves.configparser as configparser
 import time
+
+import mock
+import six.moves.configparser as configparser
 import unittest
 
 from tests.unit import STL_MOCKS
@@ -162,6 +161,11 @@ class TestConfigCreate(unittest.TestCase):
         self.assertEqual(config_create.downlink_ports, ['xe1'])
         self.assertEqual(config_create.socket, 2)
 
+    def test_dpdk_port_to_link_id(self):
+        vnfd_helper = VnfdHelper(self.VNFD_0)
+        config_create = ConfigCreate(vnfd_helper, 2)
+        self.assertEqual(config_create.dpdk_port_to_link_id_map, {'xe0': 0, 'xe1': 1})
+
     def test_vpe_initialize(self):
         vnfd_helper = VnfdHelper(self.VNFD_0)
         config_create = ConfigCreate(vnfd_helper, 2)
@@ -543,9 +547,9 @@ class TestVpeApproxVnf(unittest.TestCase):
         mock_ssh(ssh)
 
         resource = mock.Mock(autospec=ResourceProfile)
-        resource.check_if_sa_running.return_value = 1, ''
+        resource.check_if_system_agent_running.return_value = 1, ''
         resource.amqp_collect_nfvi_kpi.return_value = {'foo': 234}
-        resource.check_if_sa_running.return_value = (1, None)
+        resource.check_if_system_agent_running.return_value = (1, None)
 
         vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0)
         vpe_approx_vnf.q_in = mock.MagicMock()
@@ -567,7 +571,7 @@ class TestVpeApproxVnf(unittest.TestCase):
         mock_ssh(ssh)
 
         resource = mock.Mock(autospec=ResourceProfile)
-        resource.check_if_sa_running.return_value = 0, '1234'
+        resource.check_if_system_agent_running.return_value = 0, '1234'
         resource.amqp_collect_nfvi_kpi.return_value = {'foo': 234}
 
         vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0)
@@ -632,7 +636,7 @@ class TestVpeApproxVnf(unittest.TestCase):
     def test_build_config(self, ssh, *args):
         mock_ssh(ssh)
         vpe_approx_vnf = VpeApproxSetupEnvHelper(mock.MagicMock(),
-                                                 mock.MagicMock, mock.MagicMock)
+                                                 mock.MagicMock(), mock.MagicMock())
         vpe_approx_vnf.tc_file_name = get_file_abspath(TEST_FILE_YAML)
         vpe_approx_vnf.generate_port_pairs = mock.Mock()
         vpe_approx_vnf.vnf_cfg = {