Fix neutron-fwaas unit test failures due to multiple issues

neutron-fwaas unit tests are failing due the following issues:

[1] init parameters of router_info.RouterInfo.
[2] 'register_process_monitor_opts' in varmour router and fwaas UT.

This patch fixes those issues.

Closes-Bug: #1416522

Change-Id: I70a4b47777ea41a8070253cf17e667cb9fec0dea
This commit is contained in:
Trinath Somanchi 2015-01-31 00:41:21 +05:30
parent 0e41bb360f
commit f4bb327e31
3 changed files with 13 additions and 4 deletions

View File

@ -73,6 +73,15 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
self.api = FWaasAgent(self.conf)
self.api.fwaas_driver = test_firewall_agent_api.NoopFwaasDriver()
self.adminContext = context.get_admin_context()
self.router_id = str(uuid.uuid4())
self.ri_kwargs = {'router': {'id': self.router_id,
'tenant_id': str(uuid.uuid4())},
'root_helper': self.conf.root_helper,
'agent_conf': mock.ANY,
'interface_driver': mock.ANY,
'use_ipv6': mock.ANY,
'ns_name': "ns-" + self.router_id,
}
def test_fw_config_match(self):
test_agent_class = _setup_test_agent_class([constants.FIREWALL])
@ -345,10 +354,8 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
fake_firewall_list[0]['id'])
def _prepare_router_data(self):
router = {'id': str(uuid.uuid4()), 'tenant_id': str(uuid.uuid4())}
ns = "ns-" + router['id']
return router_info.RouterInfo(router['id'], self.conf.root_helper,
router=router, ns_name=ns)
return router_info.RouterInfo(self.router_id,
**self.ri_kwargs)
def _get_router_info_list_helper(self, use_namespaces):
self.conf.set_override('use_namespaces', use_namespaces)

View File

@ -42,6 +42,7 @@ class TestVarmourRouter(base.BaseTestCase):
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(l3_config.OPTS)
self.conf.register_opts(ha.OPTS)
agent_config.register_process_monitor_opts(self.conf)
agent_config.register_interface_driver_opts_helper(self.conf)
agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)

View File

@ -42,6 +42,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(l3_config.OPTS)
self.conf.register_opts(ha.OPTS)
agent_config.register_process_monitor_opts(self.conf)
agent_config.register_interface_driver_opts_helper(self.conf)
agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)