self.mock_ip.del_veth.assert_called_once_with(
agent.get_fip_int_device_name(router['id']))
self.mock_ip_dev.route.delete_gateway.assert_called_once_with(
- '11.22.33.42', table=16)
+ str(fip_to_rtr.ip), table=16)
f.assert_called_once_with(fip_ns_name)
+ def test_get_service_plugin_list(self):
+ service_plugins = [p_const.L3_ROUTER_NAT]
+ self.plugin_api.get_service_plugin_list.return_value = service_plugins
+ agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
+ self.assertEqual(service_plugins, agent.neutron_service_plugins)
+ self.assertTrue(self.plugin_api.get_service_plugin_list.called)
+
+ def test_get_service_plugin_list_failed(self):
+ raise_rpc = n_rpc.RemoteError()
+ self.plugin_api.get_service_plugin_list.side_effect = raise_rpc
+ agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
+ self.assertIsNone(agent.neutron_service_plugins)
+ self.assertTrue(self.plugin_api.get_service_plugin_list.called)
+
class TestL3AgentEventHandler(base.BaseTestCase):