diff options
| author | Ed Leafe <ed@leafe.com> | 2011-08-04 20:49:31 +0000 |
|---|---|---|
| committer | Ed Leafe <ed@leafe.com> | 2011-08-04 20:49:31 +0000 |
| commit | 2c63da94da4ef7f1848867eed4760bb70f9a8d82 (patch) | |
| tree | 0bc2a3cfa1a30659786b4b4bd04775e91f83f9d7 | |
| parent | 75b110aa451382cce94f10a392597b40df97839c (diff) | |
| parent | 6cb5d4d7fdf4731112cefbe6f13794b081a82c5f (diff) | |
| download | nova-2c63da94da4ef7f1848867eed4760bb70f9a8d82.tar.gz nova-2c63da94da4ef7f1848867eed4760bb70f9a8d82.tar.xz nova-2c63da94da4ef7f1848867eed4760bb70f9a8d82.zip | |
Merged trunk
| -rw-r--r-- | nova/tests/test_xenapi.py | 7 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 5f3aec700..b0b557907 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -764,12 +764,18 @@ class XenAPIMigrateInstance(test.TestCase): def test_finish_migrate(self): instance = db.instance_create(self.context, self.values) self.called = False + self.fake_vm_start_called = False + + def fake_vm_start(*args, **kwargs): + self.fake_vm_start_called = True def fake_vdi_resize(*args, **kwargs): self.called = True self.stubs.Set(stubs.FakeSessionForMigrationTests, "VDI_resize_online", fake_vdi_resize) + self.stubs.Set(vmops.VMOps, '_start', fake_vm_start) + stubs.stubout_session(self.stubs, stubs.FakeSessionForMigrationTests) stubs.stubout_loopingcall_start(self.stubs) conn = xenapi_conn.get_connection(False) @@ -791,6 +797,7 @@ class XenAPIMigrateInstance(test.TestCase): dict(base_copy='hurr', cow='durr'), network_info, resize_instance=True) self.assertEqual(self.called, True) + self.assertEqual(self.fake_vm_start_called, True) def test_finish_migrate_no_local_storage(self): tiny_type_id = \ diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 509abd767..844640b9e 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -122,7 +122,7 @@ class VMOps(object): network_info) if resize_instance: self.resize_instance(instance, vdi_uuid) - self._spawn(instance, vm_ref) + self._start(instance, vm_ref=vm_ref) def _start(self, instance, vm_ref=None): """Power on a VM instance""" |
