Merge "xenapi: Removing legacy swap-in-image."
This commit is contained in:
commit
77ed8f8728
@ -618,30 +618,6 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
|
||||
os_type="linux", architecture="x86-64")
|
||||
self.check_vm_params_for_linux()
|
||||
|
||||
def test_spawn_vhd_glance_swapdisk(self):
|
||||
# Change the default host_call_plugin to one that'll return
|
||||
# a swap disk
|
||||
orig_func = stubs.FakeSessionForVMTests.host_call_plugin
|
||||
_host_call_plugin = stubs.FakeSessionForVMTests.host_call_plugin_swap
|
||||
stubs.FakeSessionForVMTests.host_call_plugin = _host_call_plugin
|
||||
# Stubbing out firewall driver as previous stub sets a particular
|
||||
# stub for async plugin calls
|
||||
stubs.stubout_firewall_driver(self.stubs, self.conn)
|
||||
try:
|
||||
# We'll steal the above glance linux test
|
||||
self.test_spawn_vhd_glance_linux()
|
||||
finally:
|
||||
# Make sure to put this back
|
||||
stubs.FakeSessionForVMTests.host_call_plugin = orig_func
|
||||
|
||||
# We should have 2 VBDs.
|
||||
self.assertEqual(len(self.vm['VBDs']), 2)
|
||||
# Now test that we have 1.
|
||||
self.tearDown()
|
||||
self.setUp()
|
||||
self.test_spawn_vhd_glance_linux()
|
||||
self.assertEqual(len(self.vm['VBDs']), 1)
|
||||
|
||||
def test_spawn_vhd_glance_windows(self):
|
||||
self._test_spawn(IMAGE_VHD, None, None,
|
||||
os_type="windows", architecture="i386")
|
||||
@ -1410,7 +1386,6 @@ class XenAPIGenerateLocal(stubs.XenAPITestBase):
|
||||
super(XenAPIGenerateLocal, self).setUp()
|
||||
self.flags(xenapi_connection_url='test_url',
|
||||
xenapi_connection_password='test_pass',
|
||||
xenapi_generate_swap=True,
|
||||
firewall_driver='nova.virt.xenapi.firewall.'
|
||||
'Dom0IptablesFirewallDriver')
|
||||
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
|
||||
|
@ -175,16 +175,6 @@ class FakeSessionForVMTests(fake.SessionBase):
|
||||
return (super(FakeSessionForVMTests, self).
|
||||
host_call_plugin(_1, _2, plugin, method, _5))
|
||||
|
||||
def host_call_plugin_swap(self, _1, _2, plugin, method, _5):
|
||||
if (plugin, method) == ('glance', 'download_vhd'):
|
||||
root_uuid = _make_fake_vdi()
|
||||
swap_uuid = _make_fake_vdi()
|
||||
return pickle.dumps(dict(root=dict(uuid=root_uuid),
|
||||
swap=dict(uuid=swap_uuid)))
|
||||
else:
|
||||
return (super(FakeSessionForVMTests, self).
|
||||
host_call_plugin(_1, _2, plugin, method, _5))
|
||||
|
||||
def VM_start(self, _1, ref, _2, _3):
|
||||
vm = fake.get_record('VM', ref)
|
||||
if vm['power_state'] != 'Halted':
|
||||
|
Loading…
Reference in New Issue
Block a user