neutron/neutron/tests/unit
Swaminathan Vasudevan c334eb215a DVR: Clean stale snat-ns by checking its existence when agent restarts
At present there is no clear way to distinguish when the snat_namespace
object is initialized and when the actual namespace is created.
There is no way to check if the namespace already existed. The
code was only checking at the snat_namespace object instead of its
existence.

This patch addresses the issue by adding in an exists method to the
namespace object to identify the existence of the namespace in the
given agent.

This would allow us to check for the existence of the namespace,
and also allow us to identify the stale snat namespace and
delete the namespace when the gateway is cleared as the agent restarts.

This also applies for conditions when the router is manually moved
from one agent to another agent while the agent is dead. When the
agent wakes up it would clean up the stale snat namespace.

Closes-Bug: #1557909

(cherry picked from commit acd04d668b)

Conflicts:
	neutron/agent/l3/agent.py
	neutron/agent/l3/dvr_edge_ha_router.py
	neutron/agent/l3/dvr_edge_router.py
	neutron/tests/functional/agent/l3/test_dvr_router.py

Change-Id: Icb00297208813436c2a9e9a003275462293ad643
2016-08-05 15:44:12 -07:00
..
agent DVR: Clean stale snat-ns by checking its existence when agent restarts 2016-08-05 15:44:12 -07:00
api Update network object in DHCP agent with router interface changes 2016-07-16 00:50:11 +00:00
callbacks Improve callback registry devref documentation and usability 2015-08-12 10:15:07 -07:00
cmd Fix import path in neutron-sanity-check for ml2_sriov opts 2015-09-01 04:16:01 +00:00
common Add exponential back-off RPC client 2016-05-06 19:02:08 -07:00
core_extensions QoS core extension: fixed dict extension when QoS policy is unset 2015-08-08 15:44:27 +02:00
db Merge "Fix misuse of assertTrue in L3 DVR test case" into stable/liberty 2016-07-29 03:47:55 +00:00
debug Reorganize unit test tree 2015-04-06 23:28:31 +00:00
extensions Update network object in DHCP agent with router interface changes 2016-07-16 00:50:11 +00:00
hacking Restructure agent code in preparation for decomp 2015-06-26 15:06:49 +00:00
ipam Always call ipam driver on subnet update 2016-07-20 18:23:54 +03:00
notifiers When deleting floating IP catch PortNotFound 2016-07-08 15:53:38 +00:00
objects No network devices on network attached qos policies 2015-09-16 15:11:04 +02:00
plugins Update ml2 delete_subnet to deallocate via ipam 2016-07-21 15:26:22 +00:00
quota Reduce the chance of random check/gate test failures 2015-09-09 14:45:16 -07:00
scheduler Check compatibility when auto schedule ha routers 2016-07-22 01:41:45 +08:00
services Switches metering agent to stateless iptables 2016-04-01 02:47:50 +00:00
tests Fix get_free_namespace_port to actually avoid used ports 2016-06-06 09:55:47 +02:00
__init__.py oslo: migrate to namespace-less import paths 2015-02-05 15:09:32 +01:00
_test_extension_portbindings.py Context: Remove logic for read_deleted and deprecate it 2015-06-09 13:50:03 -07:00
dummy_plugin.py Remove lingering traces of q_ 2015-07-07 17:04:44 -04:00
extension_stubs.py Remove get_namespace from API extensions 2015-06-15 09:17:32 -04:00
test_auth.py oslo: migrate to namespace-less import paths 2015-02-05 15:09:32 +01:00
test_context.py Support Unicode request_id on Python 3 2015-12-14 09:02:34 +01:00
test_manager.py Flavor Framework implementation 2015-07-16 09:07:41 -07:00
test_policy.py Raise RetryRequest on policy parent not found 2016-01-29 02:15:30 -07:00
test_service.py Refactor TestRpcWorker and TestWorkerService 2015-06-16 15:49:48 +03:00
test_wsgi.py Ensure metadata agent doesn't use SSL for UNIX socket 2016-03-25 14:33:55 +01:00
testlib_api.py Improve fixture usage. 2015-07-01 14:53:48 +12:00