summaryrefslogtreecommitdiffstats
path: root/nova/tests/conductor
diff options
context:
space:
mode:
authorDevananda van der Veen <devananda.vdv@gmail.com>2013-03-01 14:05:35 -0800
committerDevananda van der Veen <devananda.vdv@gmail.com>2013-03-04 06:23:09 -0800
commitac0f6eb063fc5a5c0a9410402ecf57fae1faf594 (patch)
tree0b195bc2aeb877232f9fbc3a0344841ba2249171 /nova/tests/conductor
parent69b9016de045f8cdf3a645d51d75860ca449ec0a (diff)
downloadnova-ac0f6eb063fc5a5c0a9410402ecf57fae1faf594.tar.gz
nova-ac0f6eb063fc5a5c0a9410402ecf57fae1faf594.tar.xz
nova-ac0f6eb063fc5a5c0a9410402ecf57fae1faf594.zip
Compute manager should remove dead resources
While most hypervisors return a single - and constant - value from driver.get_available_nodes, baremetal does not. When a node is deleted from the baremetal database, it is no longer returned from driver.get_available_nodes. However, Nova's compute_node record is not directly updated. This patch allows Compute Manager to detect missing nodes within update_available_resources. It then invokes resource_tracker to update the dead node and remove it from compute. This in turn allows the ServiceGroup API to properly update the servicegroup when a baremetal node is no longer in service. Fixes bug 1138184 Change-Id: Icfff3f8e3099668806633a6a58a152b32ec8b49b
Diffstat (limited to 'nova/tests/conductor')
-rw-r--r--nova/tests/conductor/test_conductor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index 32e685623..72c04e427 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -429,6 +429,14 @@ class _BaseTestCase(object):
'fake-values', False)
self.assertEqual(result, 'fake-result')
+ def test_compute_node_delete(self):
+ node = {'id': 'fake-id'}
+ self.mox.StubOutWithMock(db, 'compute_node_delete')
+ db.compute_node_delete(self.context, node['id']).AndReturn(None)
+ self.mox.ReplayAll()
+ result = self.conductor.compute_node_delete(self.context, node)
+ self.assertEqual(result, None)
+
def test_instance_fault_create(self):
self.mox.StubOutWithMock(db, 'instance_fault_create')
db.instance_fault_create(self.context, 'fake-values').AndReturn(