summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-11-10 23:20:52 -0500
committerBrian Waldon <brian.waldon@rackspace.com>2011-11-15 09:02:25 -0800
commitd2db9790dd1c2f7a955236e01e37b579a2c87321 (patch)
tree5709f3a32683049662f32b23ecd9243970e01676 /nova/tests
parent065a7ea03d97943cd669948ebaabd5271bf2afef (diff)
Converting lock/unlock to use instance objects
Related to blueprint internal-uuids Change-Id: I5a7842953da64cd2a060e5e384d06cdf535c7a1f
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_compute.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 6ecf1a0f0..9e1887f4e 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -2021,6 +2021,25 @@ class ComputeAPITestCase(BaseTestCase):
self.compute.run_instance(self.context, instance_id)
instance = self.compute_api.get(self.context, instance_id)
self.compute_api.reset_network(self.context, instance)
+
+ def test_lock(self):
+ instance_id = self._create_instance()
+ instance = self.compute_api.get(self.context, instance_id)
+ self.compute_api.lock(self.context, instance)
+ self.compute_api.delete(self.context, instance)
+
+ def test_unlock(self):
+ instance_id = self._create_instance()
+ instance = self.compute_api.get(self.context, instance_id)
+ self.compute_api.unlock(self.context, instance)
+ self.compute_api.delete(self.context, instance)
+
+ def test_get_lock(self):
+ instance_id = self._create_instance()
+ instance = self.compute_api.get(self.context, instance_id)
+ self.assertFalse(self.compute_api.get_lock(self.context, instance))
+ db.instance_update(self.context, instance_id, {'locked': True})
+ self.assertTrue(self.compute_api.get_lock(self.context, instance))
self.compute_api.delete(self.context, instance)
def test_inject_file(self):