Neutron server returns HTML code 200 when users execute
router-list-on-l3-agent with invalid agent_id.
Users expect HTML code 404 to be returned.
Change-Id: Ifadca8d6573a94abc3580a0de4463b755ef12a24
Closes-bug:
1413500
context, [router_id], new_agent.host)
def list_routers_on_l3_agent(self, context, agent_id):
+ # Exception thrown if the requested agent does not exist.
+ self._get_agent(context, agent_id)
query = context.session.query(RouterL3AgentBinding.router_id)
query = query.filter(RouterL3AgentBinding.l3_agent_id == agent_id)
expected_code=exc.HTTPForbidden.code,
admin_context=False)
+ def test_list_routers_hosted_by_l3_agent_with_invalid_agent(self):
+ invalid_agentid = 'non_existent_agent'
+ self._list_routers_hosted_by_l3_agent(invalid_agentid,
+ exc.HTTPNotFound.code)
+
class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin,
test_agent_ext_plugin.AgentDBTestMixIn,