diff options
| author | Cerberus <matt.dietz@rackspace.com> | 2011-05-10 14:40:28 -0500 |
|---|---|---|
| committer | Cerberus <matt.dietz@rackspace.com> | 2011-05-10 14:40:28 -0500 |
| commit | 288030b2b9834ca65e822a770f1b2d052ee27a10 (patch) | |
| tree | 9ab78d2ff52591dd334c6b64cd2731f0173b703f | |
| parent | fa21330dfe94c3274102137753e608269dae5f32 (diff) | |
Test
| -rw-r--r-- | nova/tests/test_compute.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 393110791..a35132426 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -329,6 +329,32 @@ class ComputeTestCase(test.TestCase): self.compute.terminate_instance(self.context, instance_id) + def test_finish_resize(self): + """Contrived test to ensure finish_resize doesn't raise anything""" + + def fake(*args, **kwargs): pass + + self.stubs.Set(self.compute.driver, 'finish_resize', fake) + self.stubs.Set(self.compute.driver, 'finish_resize', fake) + context = self.context.elevated() + instance_id = self._create_instance() + self.compute.prep_resize(context, instance_id, 1) + migration_ref = db.migration_get_by_instance_and_status(context, + instance_id, 'pre-migrating') + try: + self.compute.finish_resize(context, instance_id, + int(migration_ref['id']), {}) + except KeyError, e: + # Only catch key errors. We want other reasons for the test to + # fail to actually error out so we don't obscure anything + self.fail() + + self.compute.terminate_instance(self.context, instance_id) + + def test_resize_instance(self): + """Ensure instance can be migrated/resized""" + instance_id = self._create_instance() + def test_resize_instance(self): """Ensure instance can be migrated/resized""" instance_id = self._create_instance() |
