summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-11-29 11:18:15 -0500
committerMark Washenberger <mark.washenberger@rackspace.com>2011-11-29 11:18:15 -0500
commit97dada8d604def2ac836465c6548a2c1260e87f5 (patch)
tree013055203256538ac9e43a2b0f26b63e960064ce /nova/tests
parente2a5955e7e979ccd039fb77df8b6e7814cdc1aa1 (diff)
Use uuids for compute manager agent update.
Related to blueprint internal-uuids. Change-Id: Ib4406f7fd4e5d91852d63785f596014cc3979fd2
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_compute.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index f03665d57..5a5d1dd9a 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -396,11 +396,22 @@ class ComputeTestCase(BaseTestCase):
def test_agent_update(self):
"""Ensure instance can have its agent updated"""
- instance_id = self._create_instance()
- self.compute.run_instance(self.context, instance_id)
- self.compute.agent_update(self.context, instance_id,
- 'http://127.0.0.1/agent', '00112233445566778899aabbccddeeff')
- self.compute.terminate_instance(self.context, instance_id)
+ called = {'agent_update': False}
+
+ def fake_driver_agent_update(self2, instance, url, md5hash):
+ called['agent_update'] = True
+ self.assertEqual(url, 'http://fake/url/')
+ self.assertEqual(md5hash, 'fakehash')
+
+ self.stubs.Set(nova.virt.fake.FakeConnection, 'agent_update',
+ fake_driver_agent_update)
+
+ instance = self._create_fake_instance()
+ self.compute.run_instance(self.context, instance['id'])
+ self.compute.agent_update(self.context, instance['uuid'],
+ 'http://fake/url/', 'fakehash')
+ self.assertTrue(called['agent_update'])
+ self.compute.terminate_instance(self.context, instance['id'])
def test_snapshot(self):
"""Ensure instance can be snapshotted"""