diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 94daf0b5..404c183a 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -1488,6 +1488,11 @@ class XenAPIGenerateLocal(stubs.XenAPITestBase): instance = db.instance_update(self.context, instance['uuid'], {'instance_type_id': 5}) + # NOTE(danms): because we're stubbing out the instance_types from + # the database, our instance['instance_type'] doesn't get properly + # filled out here, so put what we need into it + instance['instance_type']['swap'] = 1024 + def fake_generate_swap(*args, **kwargs): self.called = True self.stubs.Set(vm_utils, 'generate_swap', fake_generate_swap) @@ -1500,6 +1505,11 @@ class XenAPIGenerateLocal(stubs.XenAPITestBase): instance = db.instance_update(self.context, instance['uuid'], {'instance_type_id': 4}) + # NOTE(danms): because we're stubbing out the instance_types from + # the database, our instance['instance_type'] doesn't get properly + # filled out here, so put what we need into it + instance['instance_type']['ephemeral_gb'] = 160 + def fake_generate_ephemeral(*args): self.called = True self.stubs.Set(vm_utils, 'generate_ephemeral', fake_generate_ephemeral)