summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-08-22 17:08:11 -0400
committerAlex Meade <alex.meade@rackspace.com>2011-08-22 17:08:11 -0400
commit77f15157c5ca7013df397abc22a8866cce02976d (patch)
tree9e3bbaf2f787b2d73fc81ce4c70fac13afd30322 /nova
parent8d62d47a1148cc79c0ef0330e0c2d70177ea71c8 (diff)
Ensure that reserve and unreserve exit when an address is not found
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/test_nova_manage.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/test_nova_manage.py b/nova/tests/test_nova_manage.py
index 3a6e48dec..f5ea68a03 100644
--- a/nova/tests/test_nova_manage.py
+++ b/nova/tests/test_nova_manage.py
@@ -55,8 +55,18 @@ class FixedIpCommandsTestCase(test.TestCase):
'192.168.0.100')
self.assertEqual(address['reserved'], True)
+ def test_reserve_nonexistent_address(self):
+ self.assertRaises(SystemExit,
+ self.commands.reserve,
+ '55.55.55.55')
+
def test_unreserve(self):
self.commands.unreserve('192.168.0.100')
address = db.fixed_ip_get_by_address(context.get_admin_context(),
'192.168.0.100')
self.assertEqual(address['reserved'], False)
+
+ def test_unreserve_nonexistent_address(self):
+ self.assertRaises(SystemExit,
+ self.commands.unreserve,
+ '55.55.55.55')