diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-02-20 13:27:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-02-20 13:27:59 +0000 |
| commit | adfb9217fd4780c7b0e2abb23f44d53cff94b1d4 (patch) | |
| tree | d51bf325f74621d3a361486c50e153470b87464e | |
| parent | 8f209c622b4fe105bde914b59a4623507368e060 (diff) | |
| parent | b93d543d179f14b08aaa63429287780313744f70 (diff) | |
| download | nova-adfb9217fd4780c7b0e2abb23f44d53cff94b1d4.tar.gz nova-adfb9217fd4780c7b0e2abb23f44d53cff94b1d4.tar.xz nova-adfb9217fd4780c7b0e2abb23f44d53cff94b1d4.zip | |
Merge "Make ComputeTestCase.test_state_revert faster"
| -rw-r--r-- | nova/tests/compute/test_compute.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 2d85b6cce..6eb5feb85 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -1787,13 +1787,11 @@ class ComputeTestCase(BaseTestCase): self.compute.terminate_instance(self.context, instance=jsonutils.to_primitive(instance)) - def _test_state_revert(self, operation, pre_task_state, + def _test_state_revert(self, instance, operation, pre_task_state, post_task_state=None, kwargs=None): if kwargs is None: kwargs = {} - instance = self._create_fake_instance() - # The API would have set task_state, so do that here to test # that the state gets reverted on failure db.instance_update(self.context, instance['uuid'], @@ -1863,8 +1861,9 @@ class ComputeTestCase(BaseTestCase): ("resume_instance", task_states.RESUMING), ] + instance = self._create_fake_instance() for operation in actions: - self._test_state_revert(*operation) + self._test_state_revert(instance, *operation) def _ensure_quota_reservations_committed(self): """Mock up commit of quota reservations.""" |
