neutron/neutron/tests/unit
Swaminathan Vasudevan 9dc70ed77e DVR: Clear SNAT namespace when agent restarts after router move
When we manually move a router from one dvr_snat node to
another dvr_snat node the snat_namespace should be removed in
the originating node by the agent and will be re-created in the
destination node by the destination agent.

But when the agent dies, the router_update message reaches the
agent after the agent restarts. At this time the agent should
remove the snat_namespace since it is no more hosted by the
current agent.

Even though we do have logic in agent to take care of cleaning
up the snat namespaces if the gw_port_host does not match with the
existing agent host, in this particular use case the self.snat_namespace
is always set to 'None' in the dvr_edge_router init call when agent
restarts.

This patch fixes the above issue by initializing the snat namespace
object during the router_init. Since we do have a valid snat
namespace object and if the gw_port_host mismatches, the agent
should clean up the namespace.

Change-Id: I30524dc77b743429ef70941479c9b6cccb21c23c
Closes-Bug: #1557909
2016-05-04 11:09:26 -07:00
..
agent DVR: Clear SNAT namespace when agent restarts after router move 2016-05-04 11:09:26 -07:00
api Remove BGP code from neutron 2016-04-25 21:54:06 -07:00
callbacks Provide kwargs for callback abort 2016-01-12 21:48:05 +00:00
cmd Make netns_cleanup to purge resources of selected agent only 2016-02-11 12:19:26 +03:00
common Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
core_extensions Objects DB api: added composite key to handle multiple primary key 2016-03-01 17:05:11 +00:00
db Remove threading before process forking 2016-05-03 21:54:23 +03:00
debug tests: stop validating neutronclient in neutron-debug tests 2016-01-14 06:46:45 +00:00
extensions Remove BGP code from neutron 2016-04-25 21:54:06 -07:00
hacking Revert "Switch to inheriting hacking checks from neutron-lib" 2016-04-24 15:19:20 +00:00
ipam Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
notifiers Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
objects Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
plugins Use converters and validators from neutron-lib 2016-04-24 19:13:10 -04:00
quota Fix module's import order 2016-01-22 06:38:42 -08:00
scheduler Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
services Merge "Remove BGP code from neutron" 2016-04-27 16:20:41 +00:00
tests Fix regexp for ss output 2016-04-07 15:56:43 +00:00
__init__.py oslo: migrate to namespace-less import paths 2015-02-05 15:09:32 +01:00
_test_extension_portbindings.py Fix module's import order 2016-01-22 06:38:42 -08:00
dummy_plugin.py Use exceptions from neutron-lib 2016-04-21 21:29:44 -04:00
extension_stubs.py Add a description field to all standard resources 2016-03-05 02:29:35 +00:00
test_auth.py Fix params order in assertEqual 2016-01-13 18:24:04 +05:30
test_context.py Support Unicode request_id on Python 3 2015-11-27 16:21:16 +01:00
test_manager.py Add the ability to load a set of service plugins on startup 2016-02-10 10:04:15 -06:00
test_policy.py Use constants from neutron-lib 2016-04-23 21:23:56 -04:00
test_service.py Refactor TestRpcWorker and TestWorkerService 2015-06-16 15:49:48 +03:00
test_wsgi.py Use exceptions from neutron-lib 2016-04-21 21:29:44 -04:00
testlib_api.py Improve fixture usage. 2015-07-01 14:53:48 +12:00