fixed reviewer's comment. 1. adding dest-instance-dir deleting operation to nova.compute.manager, 2. fix invalid raise statement
This commit is contained in:
@@ -556,7 +556,10 @@ class ComputeTestCase(test.TestCase):
|
|||||||
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
||||||
AndReturn(topic)
|
AndReturn(topic)
|
||||||
rpc.call(c, topic, {"method": "pre_live_migration",
|
rpc.call(c, topic, {"method": "pre_live_migration",
|
||||||
"args": {'instance_id': i_ref['id']}})
|
"args": {'instance_id': i_ref['id'],
|
||||||
|
'block_migration': False,
|
||||||
|
'disk': None}})
|
||||||
|
|
||||||
self.mox.StubOutWithMock(self.compute.driver, 'live_migration')
|
self.mox.StubOutWithMock(self.compute.driver, 'live_migration')
|
||||||
self.compute.driver.live_migration(c, i_ref, i_ref['host'],
|
self.compute.driver.live_migration(c, i_ref, i_ref['host'],
|
||||||
self.compute.post_live_migration,
|
self.compute.post_live_migration,
|
||||||
@@ -582,7 +585,9 @@ class ComputeTestCase(test.TestCase):
|
|||||||
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
||||||
AndReturn(topic)
|
AndReturn(topic)
|
||||||
rpc.call(c, topic, {"method": "pre_live_migration",
|
rpc.call(c, topic, {"method": "pre_live_migration",
|
||||||
"args": {'instance_id': i_ref['id']}}).\
|
"args": {'instance_id': i_ref['id'],
|
||||||
|
'block_migration': False,
|
||||||
|
'disk': None}}).\
|
||||||
AndRaise(rpc.RemoteError('', '', ''))
|
AndRaise(rpc.RemoteError('', '', ''))
|
||||||
dbmock.instance_update(c, i_ref['id'], {'state_description': 'running',
|
dbmock.instance_update(c, i_ref['id'], {'state_description': 'running',
|
||||||
'state': power_state.RUNNING,
|
'state': power_state.RUNNING,
|
||||||
@@ -609,7 +614,9 @@ class ComputeTestCase(test.TestCase):
|
|||||||
AndReturn(topic)
|
AndReturn(topic)
|
||||||
self.mox.StubOutWithMock(rpc, 'call')
|
self.mox.StubOutWithMock(rpc, 'call')
|
||||||
rpc.call(c, topic, {"method": "pre_live_migration",
|
rpc.call(c, topic, {"method": "pre_live_migration",
|
||||||
"args": {'instance_id': i_ref['id']}}).\
|
"args": {'instance_id': i_ref['id'],
|
||||||
|
'block_migration': False,
|
||||||
|
'disk': None}}).\
|
||||||
AndRaise(rpc.RemoteError('', '', ''))
|
AndRaise(rpc.RemoteError('', '', ''))
|
||||||
dbmock.instance_update(c, i_ref['id'], {'state_description': 'running',
|
dbmock.instance_update(c, i_ref['id'], {'state_description': 'running',
|
||||||
'state': power_state.RUNNING,
|
'state': power_state.RUNNING,
|
||||||
@@ -634,7 +641,9 @@ class ComputeTestCase(test.TestCase):
|
|||||||
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
dbmock.queue_get_for(c, FLAGS.compute_topic, i_ref['host']).\
|
||||||
AndReturn(topic)
|
AndReturn(topic)
|
||||||
rpc.call(c, topic, {"method": "pre_live_migration",
|
rpc.call(c, topic, {"method": "pre_live_migration",
|
||||||
"args": {'instance_id': i_ref['id']}})
|
"args": {'instance_id': i_ref['id'],
|
||||||
|
'block_migration': False,
|
||||||
|
'disk': None}})
|
||||||
self.mox.StubOutWithMock(self.compute.driver, 'live_migration')
|
self.mox.StubOutWithMock(self.compute.driver, 'live_migration')
|
||||||
self.compute.driver.live_migration(c, i_ref, i_ref['host'],
|
self.compute.driver.live_migration(c, i_ref, i_ref['host'],
|
||||||
self.compute.post_live_migration,
|
self.compute.post_live_migration,
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
# large disk space.
|
# large disk space.
|
||||||
self.mox.StubOutWithMock(utils, "execute")
|
self.mox.StubOutWithMock(utils, "execute")
|
||||||
utils.execute('sudo', 'qemu-img', 'create', '-f', 'raw',
|
utils.execute('sudo', 'qemu-img', 'create', '-f', 'raw',
|
||||||
'%s/%s/disk' % (tmpdir, instance_ref.name), 10)
|
'%s/%s/disk' % (tmpdir, instance_ref.name), '10G')
|
||||||
|
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
conn = connection.LibvirtConnection(False)
|
conn = connection.LibvirtConnection(False)
|
||||||
@@ -759,10 +759,10 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
instance_ref = db.instance_create(self.context, self.test_instance)
|
instance_ref = db.instance_create(self.context, self.test_instance)
|
||||||
dummyxml = ("<domain type='kvm'><name>instance-0000000a</name>"
|
dummyxml = ("<domain type='kvm'><name>instance-0000000a</name>"
|
||||||
"<devices>"
|
"<devices>"
|
||||||
"<disk type='file'><driver type='raw'/>"
|
"<disk type='file'><driver name='qemu' type='raw'/>"
|
||||||
"<source file='/test/disk'/>"
|
"<source file='/test/disk'/>"
|
||||||
"<target dev='vda' bus='virtio'/></disk>"
|
"<target dev='vda' bus='virtio'/></disk>"
|
||||||
"<disk type='file'><driver type='qcow2'/>"
|
"<disk type='file'><driver name='qemu' type='qcow2'/>"
|
||||||
"<source file='/test/disk.local'/>"
|
"<source file='/test/disk.local'/>"
|
||||||
"<target dev='vdb' bus='virtio'/></disk>"
|
"<target dev='vdb' bus='virtio'/></disk>"
|
||||||
"</devices></domain>")
|
"</devices></domain>")
|
||||||
|
|||||||
Reference in New Issue
Block a user