summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-02 14:29:03 +0000
committerGerrit Code Review <review@openstack.org>2013-01-02 14:29:03 +0000
commit3a642467c8604e185d38ebaa8adc990cf415ff7f (patch)
treefadd18c2a6f28ad558562f2335d3db2b4acfe937 /nova/tests
parentfc3a938804866b269ca864e177e80381f1ce7062 (diff)
parent3b9f08072abe9f92d292e9fa5998c62a766b01f3 (diff)
Merge "Ignore double messages to associate the same ip"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/network/test_manager.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py
index 0e441eef8..c2aa1dbbb 100644
--- a/nova/tests/network/test_manager.py
+++ b/nova/tests/network/test_manager.py
@@ -740,15 +740,19 @@ class VlanNetworkTestCase(test.TestCase):
self.stubs.Set(self.network, 'disassociate_floating_ip', fake9)
def fake_fixed_ip_get(context, fixed_ip_id):
- return {'instance_uuid': 'fake_uuid'}
+ return {'address': 'old', 'instance_uuid': 'fake_uuid'}
self.stubs.Set(self.network.db, 'fixed_ip_get', fake_fixed_ip_get)
+ # doesn't raise because we exit early if the address is the same
+ self.network.associate_floating_ip(ctxt, mox.IgnoreArg(), 'old')
+
+ # raises because we call disassociate which is mocked
self.assertRaises(test.TestingException,
self.network.associate_floating_ip,
ctxt,
mox.IgnoreArg(),
- mox.IgnoreArg())
+ 'new')
self.stubs.Set(self.network.db, 'floating_ip_get_by_address', fake3)