diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-24 22:24:57 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-24 22:24:57 +0000 |
| commit | bf5f01ce637ad80c46c2d30bd563829f1e5bf18f (patch) | |
| tree | 8f088591fefe9601b85f27571fb5c5213aadfeb6 /nova/tests | |
| parent | b328b0422035212c844ff5bbcc03f648fb7a2779 (diff) | |
| parent | 8279240ee30d55d127e4d964a9861b721ac7cc74 (diff) | |
Merge "Handle error in associate floating IP (bug 845507)"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_network.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py index 573a308e1..200251b7e 100644 --- a/nova/tests/test_network.py +++ b/nova/tests/test_network.py @@ -636,6 +636,23 @@ class VlanNetworkTestCase(test.TestCase): def fake7(*args, **kwargs): self.local = True + def fake8(*args, **kwargs): + raise exception.ProcessExecutionError('', + 'Cannot find device "em0"\n') + + # raises because interface doesn't exist + self.stubs.Set(self.network.db, + 'floating_ip_fixed_ip_associate', + fake1) + self.stubs.Set(self.network.db, 'floating_ip_disassociate', fake1) + self.stubs.Set(self.network.driver, 'bind_floating_ip', fake8) + self.assertRaises(exception.NoFloatingIpInterface, + self.network._associate_floating_ip, + ctxt, + mox.IgnoreArg(), + mox.IgnoreArg(), + mox.IgnoreArg()) + self.stubs.Set(self.network, '_floating_ip_owned_by_project', fake1) # raises because floating_ip is already associated to a fixed_ip |
