summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-17 04:10:17 +0000
committerGerrit Code Review <review@openstack.org>2012-02-17 04:10:17 +0000
commitba930e035b65eaead5e7ea3525ea5afc5e6d41ad (patch)
tree12b684c8c7c8485925f4d8c1e544840d3d8e43ff /nova/tests
parent31d1a423761ac2d68d227559f4e3f424487333be (diff)
parent1c8ad4553b4b8d404f941c5297e3f6e42c9f7e6a (diff)
Merge "Completes fix for LP #928910 - libvirt performance"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_compute.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 6cbfb5344..07abd62c4 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -552,6 +552,17 @@ class ComputeTestCase(BaseTestCase):
instance = db.instance_get_by_uuid(self.context, instance['uuid'])
self.assertEqual(instance['power_state'], power_state.NOSTATE)
+
+ def fake_driver_get_info(self2, _instance):
+ return {'state': power_state.NOSTATE,
+ 'max_mem': 0,
+ 'mem': 0,
+ 'num_cpu': 2,
+ 'cpu_time': 0}
+
+ self.stubs.Set(nova.virt.fake.FakeConnection, 'get_info',
+ fake_driver_get_info)
+
self.assertRaises(exception.Error,
self.compute.set_admin_password,
self.context,
@@ -1453,7 +1464,7 @@ class ComputeTestCase(BaseTestCase):
# Force the compute manager to do its periodic poll
ctxt = context.get_admin_context()
- self.compute.periodic_tasks(ctxt, raise_on_error=True)
+ self.compute._sync_power_states(context.get_admin_context())
instances = db.instance_get_all(context.get_admin_context())
LOG.info(_("After force-killing instances: %s"), instances)