def setUp(self):
     super(TestCommonServicesPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self.event_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
     self.coreutil_plugin = common_services_plugin.CommonServicesPlugin()
Beispiel #2
0
 def setUp(self):
     super(VNFActionRespawn, self).setUp()
     self.context = context.get_admin_context()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
Beispiel #3
0
def _log_monitor_events(context, vnf_dict, evt_details):
    _cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()
    _cos_db_plg.create_event(context, res_id=vnf_dict['id'],
                             res_type=constants.RES_TYPE_VNF,
                             res_state=vnf_dict['status'],
                             evt_type=constants.RES_EVT_MONITOR,
                             tstamp=timeutils.utcnow(),
                             details=evt_details)
Beispiel #4
0
 def setUp(self):
     super(TestVNFMonitor, self).setUp()
     p = mock.patch('tacker.common.driver_manager.DriverManager')
     self.mock_monitor_manager = p.start()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
     self.addCleanup(p.stop)
Beispiel #5
0
 def setUp(self):
     super(TestOpenStack, self).setUp()
     self.context = context.get_admin_context()
     self.infra_driver = openstack.OpenStack()
     self._mock_heat_client()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin = \
         common_services_db_plugin.CommonServicesPluginDb()
     self.addCleanup(mock.patch.stopall)
Beispiel #6
0
 def setUp(self):
     super(TestNfvoPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self._mock_driver_manager()
     mock.patch('tacker.nfvo.nfvo_plugin.NfvoPlugin._get_vim_from_vnf',
                side_effect=dummy_get_vim).start()
     self.nfvo_plugin = nfvo_plugin.NfvoPlugin()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event'
                ).start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
Beispiel #7
0
 def setUp(self):
     super(TestOpenStack, self).setUp()
     self.context = context.get_admin_context()
     self.infra_driver = openstack.OpenStack()
     self._mock_heat_client()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin = \
         common_services_db_plugin.CommonServicesPluginDb()
     self.addCleanup(mock.patch.stopall)
     yaml.SafeLoader.add_constructor(
         yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
         lambda loader, node: dict(loader.construct_pairs(node)))
Beispiel #8
0
    def setUp(self):
        super(TestCVNFMPlugin, self).setUp()
        self.addCleanup(mock.patch.stopall)
        self.context = context.get_admin_context()
        self._mock_vim_client()
        self._stub_get_vim()
        self._mock_vnf_monitor()
        self._mock_vnf_maintenance_monitor()
        self._mock_vnf_maintenance_plugin()
        self._insert_dummy_vim()
        self.vnfm_plugin = plugin.VNFMPlugin()
        mock.patch('tacker.db.common_services.common_services_db_plugin.'
                   'CommonServicesPluginDb.create_event'
                   ).start()
        mock.patch('tacker.db.vnfm.vnfm_db.VNFMPluginDb._mgmt_driver_name',
                   return_value='noop').start()
        self.create = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                 'kubernetes_driver.Kubernetes.create',
                                 return_value=uuidutils.
                                 generate_uuid()).start()
        self.create_wait = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                      'kubernetes_driver.Kubernetes.'
                                      'create_wait').start()
        self.update = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                 'kubernetes_driver.Kubernetes.update').start()
        self.update_wait = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                      'kubernetes_driver.Kubernetes.'
                                      'update_wait').start()
        self.delete = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                 'kubernetes_driver.Kubernetes.delete').start()
        self.delete_wait = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                      'kubernetes_driver.Kubernetes.'
                                      'delete_wait').start()
        self.scale = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                'kubernetes_driver.Kubernetes.scale',
                                return_value=uuidutils.generate_uuid()).start()
        self.scale_wait = mock.patch('tacker.vnfm.infra_drivers.kubernetes.'
                                     'kubernetes_driver.Kubernetes.scale_wait',
                                     return_value=uuidutils.
                                     generate_uuid()).start()

        def _fake_spawn(func, *args, **kwargs):
            func(*args, **kwargs)

        mock.patch.object(self.vnfm_plugin, 'spawn_n',
                          _fake_spawn).start()
        self._cos_db_plugin =\
            common_services_db_plugin.CommonServicesPluginDb()
Beispiel #9
0
 def setUp(self):
     super(TestVNFMPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self._mock_vim_client()
     self._stub_get_vim()
     self._mock_device_manager()
     self._mock_vnf_monitor()
     self._mock_vnf_alarm_monitor()
     self._mock_green_pool()
     self._insert_dummy_vim()
     self.vnfm_plugin = plugin.VNFMPlugin()
     mock.patch('tacker.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
Beispiel #10
0
    def setUp(self):
        super(TestVDU, self).setUp()
        self.context = context.get_admin_context()
        self._mock_heat_client()

        mock.patch('tacker.vnfm.vim_client.VimClient.get_vim').start()
        self.additional_paramas_obj = heal_vnf_request.HealVnfAdditionalParams(
            parameter='VDU1',
            cause=["Unable to reach while monitoring resource: 'VDU1'"])
        self.heal_request_data_obj = heal_vnf_request.HealVnfRequest(
            cause='VNF monitoring fails.',
            additional_params=[self.additional_paramas_obj])
        self.heal_vdu = vdu.Vdu(self.context, vnf_dict,
                                self.heal_request_data_obj)

        mock.patch('tacker.db.common_services.common_services_db_plugin.'
                   'CommonServicesPluginDb.create_event').start()
        self._cos_db_plugin = \
            common_services_db_plugin.CommonServicesPluginDb()
        self.addCleanup(mock.patch.stopall)
Beispiel #11
0
 def __init__(self):
     super(VNFMPluginDb, self).__init__()
     self._cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()
Beispiel #12
0
 def __init__(self):
     super(vnfcluster.VnfClusterPluginBase, self).__init__()
     self._cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()