Merge "Fix invalid uuid warnings in compute api testcases"
This commit is contained in:
commit
341b28d1bd
|
@ -225,8 +225,8 @@ class BaseTestCase(test.TestCase):
|
|||
return {'id': id,
|
||||
'name': 'fake_name',
|
||||
'status': 'active',
|
||||
'properties': {'kernel_id': 'fake_kernel_id',
|
||||
'ramdisk_id': 'fake_ramdisk_id',
|
||||
'properties': {'kernel_id': uuids.kernel_id,
|
||||
'ramdisk_id': uuids.ramdisk_id,
|
||||
'something_else': 'meow'}}
|
||||
else:
|
||||
raise exception.ImageNotFound(image_id=id)
|
||||
|
@ -2160,7 +2160,9 @@ class ComputeTestCase(BaseTestCase):
|
|||
fake_notifier.NOTIFICATIONS = []
|
||||
instance.task_state = task_states.RESCUING
|
||||
instance.save()
|
||||
self.compute.rescue_instance(self.context, instance, None, True, True)
|
||||
self.compute.rescue_instance(self.context, instance, None,
|
||||
rescue_image_ref=uuids.fake_image_ref_1,
|
||||
clean_shutdown=True)
|
||||
|
||||
expected_notifications = ['compute.instance.rescue.start',
|
||||
'compute.instance.exists',
|
||||
|
@ -2282,7 +2284,7 @@ class ComputeTestCase(BaseTestCase):
|
|||
@mock.patch.object(nova.virt.fake.FakeDriver, "rescue")
|
||||
def test_rescue_with_base_image_when_image_not_specified(self,
|
||||
mock_rescue, mock_image_get):
|
||||
image_ref = "image-ref"
|
||||
image_ref = FAKE_IMAGE_REF
|
||||
system_meta = {"image_base_image_ref": image_ref}
|
||||
rescue_image_meta = {}
|
||||
params = {"task_state": task_states.RESCUING,
|
||||
|
@ -4831,7 +4833,7 @@ class ComputeTestCase(BaseTestCase):
|
|||
orig_sys_metadata = db.instance_system_metadata_get(self.context,
|
||||
inst_ref['uuid'])
|
||||
image_ref = instance["image_ref"]
|
||||
new_image_ref = image_ref + '-new_image_ref'
|
||||
new_image_ref = uuids.new_image_ref
|
||||
db.instance_update(self.context, inst_ref['uuid'],
|
||||
{'image_ref': new_image_ref})
|
||||
|
||||
|
@ -7444,8 +7446,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
'id': 'f9000000-0000-0000-0000-000000000000',
|
||||
'name': 'fake_name',
|
||||
'status': 'active',
|
||||
'properties': {'kernel_id': 'fake_kernel_id',
|
||||
'ramdisk_id': 'fake_ramdisk_id'},
|
||||
'properties': {'kernel_id': uuids.kernel_id,
|
||||
'ramdisk_id': uuids.ramdisk_id},
|
||||
}
|
||||
|
||||
def fake_show(obj, context, image_id, **kwargs):
|
||||
|
@ -7642,8 +7644,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
sys_metadata = db.instance_system_metadata_get(self.context,
|
||||
ref[0]['uuid'])
|
||||
|
||||
image_props = {'image_kernel_id': 'fake_kernel_id',
|
||||
'image_ramdisk_id': 'fake_ramdisk_id',
|
||||
image_props = {'image_kernel_id': uuids.kernel_id,
|
||||
'image_ramdisk_id': uuids.ramdisk_id,
|
||||
'image_something_else': 'meow', }
|
||||
for key, value in six.iteritems(image_props):
|
||||
self.assertIn(key, sys_metadata)
|
||||
|
@ -7901,9 +7903,9 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
sys_meta = {k: v for k, v in instance.system_metadata.items()
|
||||
if not k.startswith('instance_type')}
|
||||
self.assertEqual(sys_meta,
|
||||
{'image_kernel_id': 'fake_kernel_id',
|
||||
{'image_kernel_id': uuids.kernel_id,
|
||||
'image_min_disk': '1',
|
||||
'image_ramdisk_id': 'fake_ramdisk_id',
|
||||
'image_ramdisk_id': uuids.ramdisk_id,
|
||||
'image_something_else': 'meow',
|
||||
'preserved': 'preserve this!'})
|
||||
|
||||
|
@ -7944,7 +7946,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
def test_rebuild_with_deleted_image(self):
|
||||
# If we're given a deleted image by glance, we should not be able to
|
||||
# rebuild from it
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
self.fake_image['name'] = 'fake_name'
|
||||
self.fake_image['status'] = 'DELETED'
|
||||
self.stubs.Set(fake_image._FakeImageService, 'show', self.fake_show)
|
||||
|
@ -7958,7 +7961,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
self.fake_image['id'], 'new_password')
|
||||
|
||||
def test_rebuild_with_too_little_ram(self):
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
instance.flavor.memory_mb = 64
|
||||
instance.flavor.root_gb = 1
|
||||
|
||||
|
@ -7976,7 +7980,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
instance, self.fake_image['id'], 'new_password')
|
||||
|
||||
def test_rebuild_with_too_little_disk(self):
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
|
||||
def fake_extract_flavor(_inst, prefix=''):
|
||||
if prefix == '':
|
||||
|
@ -8004,7 +8009,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
instance, self.fake_image['id'], 'new_password')
|
||||
|
||||
def test_rebuild_with_just_enough_ram_and_disk(self):
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
|
||||
def fake_extract_flavor(_inst, prefix=''):
|
||||
if prefix == '':
|
||||
|
@ -8026,7 +8032,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
instance, self.fake_image['id'], 'new_password')
|
||||
|
||||
def test_rebuild_with_no_ram_and_disk_reqs(self):
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
|
||||
def fake_extract_flavor(_inst, prefix=''):
|
||||
if prefix == '':
|
||||
|
@ -8045,7 +8052,8 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
instance, self.fake_image['id'], 'new_password')
|
||||
|
||||
def test_rebuild_with_too_large_image(self):
|
||||
instance = self._create_fake_instance_obj(params={'image_ref': '1'})
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'image_ref': FAKE_IMAGE_REF})
|
||||
|
||||
def fake_extract_flavor(_inst, prefix=''):
|
||||
if prefix == '':
|
||||
|
@ -8122,7 +8130,7 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
mock_get_bdms):
|
||||
# Instance started with a placeholder image (for metadata)
|
||||
volume_backed_inst_2 = self._create_fake_instance_obj(
|
||||
{'image_ref': 'my_placeholder_img',
|
||||
{'image_ref': FAKE_IMAGE_REF,
|
||||
'root_device_name': '/dev/vda'})
|
||||
bdms, volume = self._fake_rescue_block_devices(volume_backed_inst_2)
|
||||
|
||||
|
@ -8264,26 +8272,32 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
# Test searching instances by image.
|
||||
|
||||
c = context.get_admin_context()
|
||||
instance1 = self._create_fake_instance_obj({'image_ref': '1234'})
|
||||
instance2 = self._create_fake_instance_obj({'image_ref': '4567'})
|
||||
instance3 = self._create_fake_instance_obj({'image_ref': '4567'})
|
||||
instance1 = self._create_fake_instance_obj(
|
||||
{'image_ref': uuids.fake_image_ref_1})
|
||||
instance2 = self._create_fake_instance_obj(
|
||||
{'image_ref': uuids.fake_image_ref_2})
|
||||
instance3 = self._create_fake_instance_obj(
|
||||
{'image_ref': uuids.fake_image_ref_2})
|
||||
|
||||
instances = self.compute_api.get_all(c, search_opts={'image': '123'})
|
||||
self.assertEqual(len(instances), 0)
|
||||
|
||||
instances = self.compute_api.get_all(c, search_opts={'image': '1234'})
|
||||
instances = self.compute_api.get_all(
|
||||
c, search_opts={'image': uuids.fake_image_ref_1})
|
||||
self.assertEqual(len(instances), 1)
|
||||
self.assertEqual(instances[0]['uuid'], instance1['uuid'])
|
||||
|
||||
instances = self.compute_api.get_all(c, search_opts={'image': '4567'})
|
||||
instances = self.compute_api.get_all(
|
||||
c, search_opts={'image': uuids.fake_image_ref_2})
|
||||
self.assertEqual(len(instances), 2)
|
||||
instance_uuids = [instance['uuid'] for instance in instances]
|
||||
self.assertIn(instance2['uuid'], instance_uuids)
|
||||
self.assertIn(instance3['uuid'], instance_uuids)
|
||||
|
||||
# Test passing a list as search arg
|
||||
instances = self.compute_api.get_all(c,
|
||||
search_opts={'image': ['1234', '4567']})
|
||||
instances = self.compute_api.get_all(
|
||||
c, search_opts={'image': [uuids.fake_image_ref_1,
|
||||
uuids.fake_image_ref_2]})
|
||||
self.assertEqual(len(instances), 3)
|
||||
|
||||
def test_get_all_by_flavor(self):
|
||||
|
@ -10251,22 +10265,25 @@ class ComputeAPITestCase(BaseTestCase):
|
|||
|
||||
@mock.patch("nova.db.migration_get_in_progress_by_instance")
|
||||
def test_get_migrations_in_progress_by_instance(self, mock_get):
|
||||
migration = test_migration.fake_db_migration(instance_uuid="1234")
|
||||
migration = test_migration.fake_db_migration(
|
||||
instance_uuid=uuids.instance)
|
||||
mock_get.return_value = [migration]
|
||||
db.migration_get_in_progress_by_instance(self.context, "1234")
|
||||
db.migration_get_in_progress_by_instance(self.context,
|
||||
uuids.instance)
|
||||
migrations = self.compute_api.get_migrations_in_progress_by_instance(
|
||||
self.context, "1234")
|
||||
self.context, uuids.instance)
|
||||
self.assertEqual(1, len(migrations))
|
||||
self.assertEqual(migrations[0].id, migration['id'])
|
||||
|
||||
@mock.patch("nova.db.migration_get_by_id_and_instance")
|
||||
def test_get_migration_by_id_and_instance(self, mock_get):
|
||||
migration = test_migration.fake_db_migration(instance_uuid="1234")
|
||||
migration = test_migration.fake_db_migration(
|
||||
instance_uuid=uuids.instance)
|
||||
mock_get.return_value = migration
|
||||
db.migration_get_by_id_and_instance(
|
||||
self.context, migration['id'], uuid)
|
||||
res = self.compute_api.get_migration_by_id_and_instance(
|
||||
self.context, migration['id'], "1234")
|
||||
self.context, migration['id'], uuids.instance)
|
||||
self.assertEqual(res.id, migration['id'])
|
||||
|
||||
|
||||
|
@ -11407,8 +11424,8 @@ class ComputeInactiveImageTestCase(BaseTestCase):
|
|||
def fake_show(meh, context, id, **kwargs):
|
||||
return {'id': id, 'name': 'fake_name', 'status': 'deleted',
|
||||
'min_ram': 0, 'min_disk': 0,
|
||||
'properties': {'kernel_id': 'fake_kernel_id',
|
||||
'ramdisk_id': 'fake_ramdisk_id',
|
||||
'properties': {'kernel_id': uuids.kernel_id,
|
||||
'ramdisk_id': uuids.ramdisk_id,
|
||||
'something_else': 'meow'}}
|
||||
|
||||
fake_image.stub_out_image_service(self)
|
||||
|
|
|
@ -47,6 +47,7 @@ from nova.objects import block_device as block_device_obj
|
|||
from nova.objects import migrate_data as migrate_data_obj
|
||||
from nova import test
|
||||
from nova.tests import fixtures
|
||||
from nova.tests.unit.api.openstack import fakes
|
||||
from nova.tests.unit.compute import fake_resource_tracker
|
||||
from nova.tests.unit import fake_block_device
|
||||
from nova.tests.unit import fake_flavor
|
||||
|
@ -72,7 +73,8 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
super(ComputeManagerUnitTestCase, self).setUp()
|
||||
self.flags(use_local=True, group='conductor')
|
||||
self.compute = importutils.import_object(CONF.compute_manager)
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.context = context.RequestContext(fakes.FAKE_USER_ID,
|
||||
fakes.FAKE_PROJECT_ID)
|
||||
fake_server_actions.stub_out_action_events(self.stubs)
|
||||
|
||||
self.useFixture(fixtures.SpawnIsSynchronousFixture())
|
||||
|
@ -183,7 +185,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
avail_nodes_l = list(avail_nodes)
|
||||
rts = [self._make_rt(node) for node in avail_nodes_l]
|
||||
# Make the 2nd and 3rd ones raise
|
||||
exc = exception.ComputeHostNotFound(host='fake')
|
||||
exc = exception.ComputeHostNotFound(host=uuids.fake_host)
|
||||
rts[1].update_available_resource.side_effect = exc
|
||||
exc = test.TestingException()
|
||||
rts[2].update_available_resource.side_effect = exc
|
||||
|
@ -664,7 +666,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
"""
|
||||
instance = fake_instance.fake_instance_obj(
|
||||
self.context,
|
||||
project_id='fake',
|
||||
project_id=fakes.FAKE_PROJECT_ID,
|
||||
uuid=uuids.instance,
|
||||
vcpus=1,
|
||||
memory_mb=64,
|
||||
|
@ -711,7 +713,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
self, mock_log):
|
||||
instance = fake_instance.fake_instance_obj(
|
||||
self.context,
|
||||
project_id='fake',
|
||||
project_id=fakes.FAKE_PROJECT_ID,
|
||||
uuid=uuids.instance,
|
||||
vcpus=1,
|
||||
memory_mb=64,
|
||||
|
@ -735,7 +737,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
def test_init_instance_stuck_in_deleting(self):
|
||||
instance = fake_instance.fake_instance_obj(
|
||||
self.context,
|
||||
project_id='fake',
|
||||
project_id=fakes.FAKE_PROJECT_ID,
|
||||
uuid=uuids.instance,
|
||||
vcpus=1,
|
||||
memory_mb=64,
|
||||
|
@ -772,7 +774,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
|
||||
instance = fake_instance.fake_instance_obj(
|
||||
self.context,
|
||||
project_id='fake',
|
||||
project_id=fakes.FAKE_PROJECT_ID,
|
||||
uuid=uuids.instance,
|
||||
vcpus=1,
|
||||
memory_mb=64,
|
||||
|
@ -1049,7 +1051,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
def test_init_instance_deletes_error_deleting_instance(self):
|
||||
instance = fake_instance.fake_instance_obj(
|
||||
self.context,
|
||||
project_id='fake',
|
||||
project_id=fakes.FAKE_PROJECT_ID,
|
||||
uuid=uuids.instance,
|
||||
vcpus=1,
|
||||
memory_mb=64,
|
||||
|
@ -2401,7 +2403,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
self.context, vm_state=vm_states.ACTIVE)
|
||||
fake_nw_info = network_model.NetworkInfo()
|
||||
rescue_image_meta = objects.ImageMeta.from_dict(
|
||||
{'id': 'fake', 'name': 'fake'})
|
||||
{'id': uuids.image_id, 'name': uuids.image_name})
|
||||
with test.nested(
|
||||
mock.patch.object(self.context, 'elevated',
|
||||
return_value=self.context),
|
||||
|
@ -2436,7 +2438,7 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
get_rescue_image.assert_called_once_with(
|
||||
self.context, instance, None)
|
||||
|
||||
extra_usage_info = {'rescue_image_name': 'fake'}
|
||||
extra_usage_info = {'rescue_image_name': uuids.image_name}
|
||||
notify_calls = [
|
||||
mock.call(self.context, instance, "rescue.start",
|
||||
extra_usage_info=extra_usage_info,
|
||||
|
@ -2852,13 +2854,13 @@ class ComputeManagerUnitTestCase(test.NoDBTestCase):
|
|||
'rebuild.error', fault=ex)
|
||||
|
||||
def test_rebuild_deleting(self):
|
||||
instance = objects.Instance(uuid='fake-uuid')
|
||||
instance = objects.Instance(uuid=uuids.instance)
|
||||
ex = exception.UnexpectedDeletingTaskStateError(
|
||||
instance_uuid=instance.uuid, expected='expected', actual='actual')
|
||||
self._test_rebuild_ex(instance, ex)
|
||||
|
||||
def test_rebuild_notfound(self):
|
||||
instance = objects.Instance(uuid='fake-uuid')
|
||||
instance = objects.Instance(uuid=uuids.instance)
|
||||
ex = exception.InstanceNotFound(instance_id=instance.uuid)
|
||||
self._test_rebuild_ex(instance, ex)
|
||||
|
||||
|
@ -3132,7 +3134,8 @@ class ComputeManagerBuildInstanceTestCase(test.NoDBTestCase):
|
|||
def setUp(self):
|
||||
super(ComputeManagerBuildInstanceTestCase, self).setUp()
|
||||
self.compute = importutils.import_object(CONF.compute_manager)
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.context = context.RequestContext(fakes.FAKE_USER_ID,
|
||||
fakes.FAKE_PROJECT_ID)
|
||||
self.instance = fake_instance.fake_instance_obj(self.context,
|
||||
vm_state=vm_states.ACTIVE,
|
||||
expected_attrs=['metadata', 'system_metadata', 'info_cache'])
|
||||
|
@ -4294,7 +4297,8 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
|
|||
def setUp(self):
|
||||
super(ComputeManagerMigrationTestCase, self).setUp()
|
||||
self.compute = importutils.import_object(CONF.compute_manager)
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.context = context.RequestContext(fakes.FAKE_USER_ID,
|
||||
fakes.FAKE_PROJECT_ID)
|
||||
self.image = {}
|
||||
self.instance = fake_instance.fake_instance_obj(self.context,
|
||||
vm_state=vm_states.ACTIVE,
|
||||
|
@ -4722,7 +4726,7 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
|
|||
@mock.patch.object(self.compute, '_get_power_state', return_value=1)
|
||||
@mock.patch.object(self.compute, '_get_compute_info',
|
||||
side_effect=exception.ComputeHostNotFound(
|
||||
host='fake'))
|
||||
host=uuids.fake_host))
|
||||
@mock.patch.object(self.compute.driver,
|
||||
'post_live_migration_at_destination')
|
||||
def _do_test(post_live_migration_at_destination, _get_compute_info,
|
||||
|
|
|
@ -58,7 +58,7 @@ def create_instance(context, user_id='fake', project_id='fake', params=None):
|
|||
net_info = model.NetworkInfo([])
|
||||
info_cache = objects.InstanceInfoCache(network_info=net_info)
|
||||
inst = objects.Instance(context=context,
|
||||
image_ref=1,
|
||||
image_ref=uuids.fake_image_ref,
|
||||
reservation_id='r-fakeres',
|
||||
user_id=user_id,
|
||||
project_id=project_id,
|
||||
|
@ -445,7 +445,8 @@ class UsageInfoTestCase(test.TestCase):
|
|||
"Key %s not in payload" % attr)
|
||||
self.assertEqual(payload['image_meta'],
|
||||
{'md_key1': 'val1', 'md_key2': 'val2'})
|
||||
image_ref_url = "%s/images/1" % glance.generate_glance_url()
|
||||
image_ref_url = "%s/images/%s" % (glance.generate_glance_url(),
|
||||
uuids.fake_image_ref)
|
||||
self.assertEqual(payload['image_ref_url'], image_ref_url)
|
||||
self.compute.terminate_instance(self.context, instance, [], [])
|
||||
|
||||
|
@ -480,7 +481,8 @@ class UsageInfoTestCase(test.TestCase):
|
|||
self.assertIn(attr, payload, "Key %s not in payload" % attr)
|
||||
self.assertEqual(payload['image_meta'],
|
||||
{'md_key1': 'val1', 'md_key2': 'val2'})
|
||||
image_ref_url = "%s/images/1" % glance.generate_glance_url()
|
||||
image_ref_url = "%s/images/%s" % (glance.generate_glance_url(),
|
||||
uuids.fake_image_ref)
|
||||
self.assertEqual(payload['image_ref_url'], image_ref_url)
|
||||
|
||||
def test_notify_usage_exists_instance_not_found(self):
|
||||
|
@ -507,7 +509,8 @@ class UsageInfoTestCase(test.TestCase):
|
|||
'audit_period_ending', 'image_meta'):
|
||||
self.assertIn(attr, payload, "Key %s not in payload" % attr)
|
||||
self.assertEqual(payload['image_meta'], {})
|
||||
image_ref_url = "%s/images/1" % glance.generate_glance_url()
|
||||
image_ref_url = "%s/images/%s" % (glance.generate_glance_url(),
|
||||
uuids.fake_image_ref)
|
||||
self.assertEqual(payload['image_ref_url'], image_ref_url)
|
||||
|
||||
def test_notify_about_instance_usage(self):
|
||||
|
@ -542,7 +545,8 @@ class UsageInfoTestCase(test.TestCase):
|
|||
self.assertEqual(payload['image_meta'],
|
||||
{'md_key1': 'val1', 'md_key2': 'val2'})
|
||||
self.assertEqual(payload['image_name'], 'fake_name')
|
||||
image_ref_url = "%s/images/1" % glance.generate_glance_url()
|
||||
image_ref_url = "%s/images/%s" % (glance.generate_glance_url(),
|
||||
uuids.fake_image_ref)
|
||||
self.assertEqual(payload['image_ref_url'], image_ref_url)
|
||||
self.compute.terminate_instance(self.context, instance, [], [])
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ from nova import db
|
|||
from nova import objects
|
||||
from nova.tests.unit.compute import test_compute
|
||||
from nova.tests.unit.image import fake as fake_image
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
@ -182,7 +183,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
|
|||
instance = self._create_fake_instance_obj()
|
||||
instance.task_state = task_states.UNSHELVING
|
||||
instance.save()
|
||||
image = {'id': 'fake_id'}
|
||||
image = {'id': uuids.image_id}
|
||||
node = test_compute.NODENAME
|
||||
limits = {}
|
||||
filter_properties = {'limits': limits}
|
||||
|
@ -281,7 +282,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
|
|||
filter_properties = {'limits': limits}
|
||||
instance.task_state = task_states.UNSHELVING
|
||||
instance.save()
|
||||
image_meta = {'properties': {'base_image_ref': 'fake_id'}}
|
||||
image_meta = {'properties': {'base_image_ref': uuids.image_id}}
|
||||
mock_image_meta.return_value = image_meta
|
||||
|
||||
self.mox.StubOutWithMock(self.compute, '_notify_about_instance_usage')
|
||||
|
|
Loading…
Reference in New Issue