diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 22:16:34 -0600 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 22:16:34 -0600 |
| commit | a4088ce75347acb2ee2f2550c185afb4ce3231de (patch) | |
| tree | 5e3ffcfc1b6a25272c309417d8ec91389fdf39d5 | |
| parent | 4531600425d71659581aa549bdc5e719e41efc9e (diff) | |
| download | nova-a4088ce75347acb2ee2f2550c185afb4ce3231de.tar.gz nova-a4088ce75347acb2ee2f2550c185afb4ce3231de.tar.xz nova-a4088ce75347acb2ee2f2550c185afb4ce3231de.zip | |
fixed the compute lock test
| -rw-r--r-- | nova/tests/test_compute.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 78582b75a..993c4fd3c 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -175,17 +175,17 @@ class ComputeTestCase(test.TestCase): """ensure locked instance cannot be changed""" instance_id = self._create_instance() self.compute.run_instance(self.context, instance_id) - self.compute.lock_instance(self.context, instance_id) non_admin_context = context.RequestContext(None, None, False, False) - # decorator for reboot should return False + # decorator should return False (fail) with locked nonadmin context + self.compute.lock_instance(self.context, instance_id) ret_val = self.compute.reboot_instance(non_admin_context,instance_id) self.assertEqual(ret_val, False) - # decorator for pause should return the result of the function reboot + # decorator should return None (success) with unlocked nonadmin context self.compute.unlock_instance(self.context, instance_id) ret_val = self.compute.reboot_instance(non_admin_context,instance_id) - self.assertNotEqual(ret_val, None) + self.assertEqual(ret_val, None) self.compute.terminate_instance(self.context, instance_id) |
