summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/db/test_db_api.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/tests/db/test_db_api.py b/nova/tests/db/test_db_api.py
index d40d05bdb..b952b4b00 100644
--- a/nova/tests/db/test_db_api.py
+++ b/nova/tests/db/test_db_api.py
@@ -1240,17 +1240,22 @@ class AggregateDBApiTestCase(test.TestCase):
def test_aggregate_get_by_host(self):
ctxt = context.get_admin_context()
values = {'name': 'fake_aggregate2'}
+ values2 = {'name': 'fake_aggregate4'}
a1 = _create_aggregate_with_hosts(context=ctxt)
a2 = _create_aggregate_with_hosts(context=ctxt, values=values)
+ # a3 has no hosts and should not be in the results.
+ a3 = _create_aggregate(context=ctxt, values=values2)
r1 = db.aggregate_get_by_host(ctxt, 'foo.openstack.org')
self.assertEqual([a1['id'], a2['id']], [x['id'] for x in r1])
def test_aggregate_get_by_host_with_key(self):
ctxt = context.get_admin_context()
values = {'name': 'fake_aggregate2'}
+ values2 = {'name': 'fake_aggregate4'}
a1 = _create_aggregate_with_hosts(context=ctxt,
metadata={'goodkey': 'good'})
a2 = _create_aggregate_with_hosts(context=ctxt, values=values)
+ a3 = _create_aggregate(context=ctxt, values=values2)
# filter result by key
r1 = db.aggregate_get_by_host(ctxt, 'foo.openstack.org', key='goodkey')
self.assertEqual([a1['id']], [x['id'] for x in r1])