Ejemplo n.º 1
0
 def setup_rpc(self):
     # RPC support
     self.topic = topics.L3PLUGIN
     self.conn = n_rpc.create_connection()
     self.agent_notifiers[bc.constants.AGENT_TYPE_L3] = (
         l3_rpc_agent_api.L3AgentNotifyAPI())
     self.agent_notifiers[cisco_constants.AGENT_TYPE_L3_CFG] = (
         l3_router_rpc_cfg_agent_api.L3RouterCfgAgentNotifyAPI(self))
     self.endpoints = [l3_rpc.L3RpcCallback(),
                       l3cfg_rpc.L3RouterCfgRpcCallback(self)]
     self.conn.create_consumer(self.topic, self.endpoints,
                               fanout=False)
     # Consume from all consumers in threads
     self.conn.consume_in_threads()
 def setUp(self):
     self.l3_plugin = mock.MagicMock()
     self.cb = l3_router_cfg_agent_rpc_cb.L3RouterCfgRpcCallback(
         self.l3_plugin)
     self.contextMock = mock.MagicMock()
     super(TestCfgAgentL3RouterCallbacks, self).setUp()