diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-11 13:38:32 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-11 13:38:32 +0000 |
| commit | d6662021acbee9d3db9e92637dbe23121fb6d007 (patch) | |
| tree | e564610db878f29780185c162f02a55390a40166 /nova/tests | |
| parent | fcedc02a6f320681ae20bc1641c8bf6cd519885e (diff) | |
| parent | 3f6a2d1621ce4bdca4fb95d561e1dd703c0737bd (diff) | |
Merge "Make nova/virt use aggregate['metadetails']"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_xenapi.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index f570e9959..b226b34df 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -2399,23 +2399,31 @@ class ResourcePoolWithStubs(StubDependencies, pool.ResourcePool): class HypervisorPoolTestCase(test.TestCase): + fake_aggregate = { + 'id': 98, + 'hosts': [], + 'metadetails': { + 'master_compute': 'master', + pool_states.POOL_FLAG: {}, + pool_states.KEY: {} + } + } + def test_slave_asks_master_to_add_slave_to_pool(self): slave = ResourcePoolWithStubs() - aggregate = {'id': 98, 'hosts': []} - slave.add_to_aggregate("CONTEXT", aggregate, "slave") + slave.add_to_aggregate("CONTEXT", self.fake_aggregate, "slave") self.assertIn( (slave.compute_rpcapi.add_aggregate_host, - "CONTEXT", jsonutils.to_primitive(aggregate), + "CONTEXT", jsonutils.to_primitive(self.fake_aggregate), "slave", "master", "SLAVE_INFO"), slave.compute_rpcapi._mock_calls) def test_slave_asks_master_to_remove_slave_from_pool(self): slave = ResourcePoolWithStubs() - aggregate = {'id': 98, 'hosts': []} - slave.remove_from_aggregate("CONTEXT", aggregate, "slave") + slave.remove_from_aggregate("CONTEXT", self.fake_aggregate, "slave") self.assertIn( (slave.compute_rpcapi.remove_aggregate_host, |
