summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorAnte Karamatic <ante.karamatic@canonical.com>2013-04-20 10:50:14 +0200
committerAnte Karamatic <ante.karamatic@canonical.com>2013-04-26 09:06:20 +0200
commit5fb947208e7141e572d7e2e95165c715f23b5fda (patch)
tree2cb2dfa17bdeb3dbc4637b0eb28118b1798b570a /nova/tests
parentb17715174e8cdd98fe336ee79660860890cf6dce (diff)
Destroy conntrack table on source host during migration
If a VM migrates from hostA to hostB, there will still be connections in the conntrack table of the hostA. If, for any reason, VM is migrated back to the hostA, while those connections are still in conntrack table, persistent connections (such is ssh) to VM, from outside, will get dropped. They get dropped cause hostA was expecting different packets and cause of that requires establishing new connection. By dropping conntrack table entries for VM we make sure that connection flow is not interupted by old packets. Change-Id: If8e146e05914e9febd6fc40a1d8085306c1244ea
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/network/test_manager.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py
index f0d8e58a9..7fa347ceb 100644
--- a/nova/tests/network/test_manager.py
+++ b/nova/tests/network/test_manager.py
@@ -2161,6 +2161,10 @@ class FloatingIPTestCase(test.TestCase):
network):
called['count'] += 1
+ def fake_clean_conntrack(fixed_ip):
+ if not fixed_ip == "10.0.0.2":
+ raise exception.FixedIpInvalid(address=fixed_ip)
+
def fake_floating_ip_update(context, address, args):
pass
@@ -2173,6 +2177,8 @@ class FloatingIPTestCase(test.TestCase):
fake_floating_ip_update)
self.stubs.Set(self.network.l3driver, 'remove_floating_ip',
fake_remove_floating_ip)
+ self.stubs.Set(self.network.l3driver, 'clean_conntrack',
+ fake_clean_conntrack)
self.mox.ReplayAll()
addresses = ['172.24.4.23', '172.24.4.24', '172.24.4.25']
self.network.migrate_instance_start(self.context,