Merge "Don't stuff non-db data into instance dict"
This commit is contained in:
@@ -1925,7 +1925,8 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
fake_none)
|
fake_none)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
conn.spawn(self.context, instance, None, network_info)
|
conn.spawn(self.context, instance, None, [], 'herp',
|
||||||
|
network_info=network_info)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
# assert that no exception is raised due to sha1 receiving an int
|
# assert that no exception is raised due to sha1 receiving an int
|
||||||
self.assertEqual(-1, unicode(e).find('must be string or buffer'
|
self.assertEqual(-1, unicode(e).find('must be string or buffer'
|
||||||
|
|||||||
@@ -206,9 +206,8 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
|
|||||||
instance_ref = test_utils.get_test_instance()
|
instance_ref = test_utils.get_test_instance()
|
||||||
network_info = test_utils.get_test_network_info()
|
network_info = test_utils.get_test_network_info()
|
||||||
image_info = test_utils.get_test_image_info(None, instance_ref)
|
image_info = test_utils.get_test_image_info(None, instance_ref)
|
||||||
self.connection.spawn(self.ctxt, instance=instance_ref,
|
self.connection.spawn(self.ctxt, instance_ref, image_info,
|
||||||
image_meta=image_info,
|
[], 'herp', network_info=network_info)
|
||||||
network_info=network_info)
|
|
||||||
return instance_ref, network_info
|
return instance_ref, network_info
|
||||||
|
|
||||||
@catch_notimplementederror
|
@catch_notimplementederror
|
||||||
@@ -279,7 +278,7 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
|
|||||||
@catch_notimplementederror
|
@catch_notimplementederror
|
||||||
def test_rescue(self):
|
def test_rescue(self):
|
||||||
instance_ref, network_info = self._get_running_instance()
|
instance_ref, network_info = self._get_running_instance()
|
||||||
self.connection.rescue(self.ctxt, instance_ref, network_info, None)
|
self.connection.rescue(self.ctxt, instance_ref, network_info, None, '')
|
||||||
|
|
||||||
@catch_notimplementederror
|
@catch_notimplementederror
|
||||||
def test_unrescue_unrescued_instance(self):
|
def test_unrescue_unrescued_instance(self):
|
||||||
@@ -289,7 +288,7 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
|
|||||||
@catch_notimplementederror
|
@catch_notimplementederror
|
||||||
def test_unrescue_rescued_instance(self):
|
def test_unrescue_rescued_instance(self):
|
||||||
instance_ref, network_info = self._get_running_instance()
|
instance_ref, network_info = self._get_running_instance()
|
||||||
self.connection.rescue(self.ctxt, instance_ref, network_info, None)
|
self.connection.rescue(self.ctxt, instance_ref, network_info, None, '')
|
||||||
self.connection.unrescue(instance_ref, network_info)
|
self.connection.unrescue(instance_ref, network_info)
|
||||||
|
|
||||||
@catch_notimplementederror
|
@catch_notimplementederror
|
||||||
|
|||||||
@@ -552,12 +552,10 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
|
|||||||
# NOTE(tr3buchet): this is a terrible way to do this...
|
# NOTE(tr3buchet): this is a terrible way to do this...
|
||||||
network_info[0]['network']['subnets'][0]['dns'] = []
|
network_info[0]['network']['subnets'][0]['dns'] = []
|
||||||
|
|
||||||
# admin_pass isn't part of the DB model, but it does get set as
|
|
||||||
# an attribute for spawn to use
|
|
||||||
instance.admin_pass = 'herp'
|
|
||||||
image_meta = {'id': IMAGE_VHD,
|
image_meta = {'id': IMAGE_VHD,
|
||||||
'disk_format': 'vhd'}
|
'disk_format': 'vhd'}
|
||||||
self.conn.spawn(self.context, instance, image_meta, network_info)
|
self.conn.spawn(self.context, instance, image_meta, [], 'herp',
|
||||||
|
network_info)
|
||||||
self.create_vm_record(self.conn, os_type, instance['name'])
|
self.create_vm_record(self.conn, os_type, instance['name'])
|
||||||
self.check_vm_record(self.conn, check_injection)
|
self.check_vm_record(self.conn, check_injection)
|
||||||
self.assertTrue(instance.os_type)
|
self.assertTrue(instance.os_type)
|
||||||
@@ -790,7 +788,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
|
|||||||
conn = xenapi_conn.XenAPIDriver(False)
|
conn = xenapi_conn.XenAPIDriver(False)
|
||||||
image_meta = {'id': IMAGE_VHD,
|
image_meta = {'id': IMAGE_VHD,
|
||||||
'disk_format': 'vhd'}
|
'disk_format': 'vhd'}
|
||||||
conn.rescue(self.context, instance, [], image_meta)
|
conn.rescue(self.context, instance, [], image_meta, '')
|
||||||
|
|
||||||
vm = xenapi_fake.get_record('VM', vm_ref)
|
vm = xenapi_fake.get_record('VM', vm_ref)
|
||||||
rescue_name = "%s-rescue" % vm["name_label"]
|
rescue_name = "%s-rescue" % vm["name_label"]
|
||||||
@@ -881,8 +879,8 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
|
|||||||
image_meta = {'id': IMAGE_VHD,
|
image_meta = {'id': IMAGE_VHD,
|
||||||
'disk_format': 'vhd'}
|
'disk_format': 'vhd'}
|
||||||
if spawn:
|
if spawn:
|
||||||
instance.admin_pass = 'herp'
|
self.conn.spawn(self.context, instance, image_meta, [], 'herp',
|
||||||
self.conn.spawn(self.context, instance, image_meta, network_info)
|
network_info)
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user