From a36288351af519ef62ad4f52b3e3e38601ba3f58 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 30 Aug 2012 18:37:47 +0000 Subject: xenapi: Removing legacy swap-in-image. This patch removes our legacy handling of swap in the image. Now that we're generating swap on-the-fly, this stop-gap solution can go away. Change-Id: Ied3198f77af8dabb6cfbf2ab9cfb3a4eb18e32ea --- nova/tests/test_xenapi.py | 25 ------------------------- nova/tests/xenapi/stubs.py | 10 ---------- 2 files changed, 35 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index b543f3e0f..cb1ce40c6 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -617,30 +617,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") @@ -1372,7 +1348,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) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index 3bfdd3dbe..397312469 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -178,16 +178,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': -- cgit