def _start_rpc_listeners(self):
     self.notifier = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self.endpoints = [ovsvapp_rpc.OVSvAppServerRpcCallback(self.notifier)]
     self.topic = constants.OVSVAPP
     self.conn = n_rpc.create_connection(new=True)
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     return self.conn.consume_in_threads()
 def test_enhanced_sg_provider_updated(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT, self.sg_topic,
                                              topics.UPDATE),
                        'enhanced_sg_provider_updated',
                        rpc_method='cast',
                        fanout=True,
                        network_id=FAKE_NETWORK_ID)
 def test_device_delete(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              ovsvapp_const.DEVICE,
                                              topics.DELETE),
                        'device_delete',
                        rpc_method='call',
                        network_info='fake_network_info',
                        host=FAKE_HOST)
 def test_device_update(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              self.cluster_device_topic,
                                              topics.UPDATE),
                        'device_update', rpc_method='cast',
                        fanout=True,
                        device_data='fake_device_data',
                        cluster_id=FAKE_CLUSTER_ID)
 def test_device_delete(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              self.cluster_device_topic,
                                              topics.DELETE),
                        'device_delete', rpc_method='cast',
                        fanout=True,
                        network_info='fake_network_info',
                        host=FAKE_HOST,
                        cluster_id=FAKE_CLUSTER_ID)
 def _start_rpc_listeners(self):
     self.notifier = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self.ovsvapp_sg_server_rpc = (
         ovsvapp_rpc.OVSvAppSecurityGroupServerRpcMixin())
     self.endpoints = [ovsvapp_rpc.OVSvAppServerRpcCallback(
                       self.notifier, self.ovsvapp_sg_server_rpc),
                       ovsvapp_rpc.OVSvAppSecurityGroupServerRpcCallback(
                       self.ovsvapp_sg_server_rpc)]
     self.topic = ovsvapp_const.OVSVAPP
     self.conn = n_rpc.create_connection()
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     return self.conn.consume_in_threads()
 def test_device_create(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              ovsvapp_const.DEVICE,
                                              topics.CREATE),
                        'device_create',
                        rpc_method='cast',
                        fanout=True,
                        device='fake_device',
                        ports='fake_ports',
                        sg_rules='fake_sg_rules')
 def test_device_create(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              self.cluster_device_topic,
                                              topics.CREATE),
                        'device_create', rpc_method='cast',
                        fanout=True,
                        device='fake_device',
                        ports='fake_ports',
                        sg_rules='fake_sg_rules',
                        cluster_id=FAKE_CLUSTER_ID)
Exemple #9
0
 def setUp(self):
     super(TestAgentMonitor, self).setUp()
     cfg.CONF.set_default('agent_down_time', 10)
     cfg.CONF.set_override('core_plugin',
                           "neutron.plugins.ml2.plugin.Ml2Plugin")
     self.plugin = FakePlugin()
     self.context = neutron_context.get_admin_context()
     self.notifier = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self.ovsvapp_monitor = ovsvapp_monitor.AgentMonitor()
     self.ovsvapp_monitor.context = self.context
     self.ovsvapp_monitor.plugin = self.plugin
     self.ovsvapp_monitor.notifier = self.notifier
     self.ovsvapp_monitor.agent_ext_support = True
     self.LOG = ovsvapp_monitor.LOG