summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-04-10 22:32:02 +0000
committerGerrit Code Review <review@openstack.org>2013-04-10 22:32:02 +0000
commit7abb96db7410f0e46be3e470cb282d385a8964f3 (patch)
tree2fda24cd54832b81330f286743a747968deb01fe /nova/tests
parent32456dc736b834eab1d534eecca5edeef5086d6d (diff)
parentba9cd2a545a0c198990f649b6a2985a22102930f (diff)
Merge "Change DB API instance functions for selective metadata fetching"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/conductor/test_conductor.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index f4c6dde61..e339ecf44 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -670,7 +670,8 @@ class ConductorTestCase(_BaseTestCase, test.TestCase):
filters = {'foo': 'bar'}
self.mox.StubOutWithMock(db, 'instance_get_all_by_filters')
db.instance_get_all_by_filters(self.context, filters,
- 'fake-key', 'fake-sort')
+ 'fake-key', 'fake-sort',
+ columns_to_join=None)
self.mox.ReplayAll()
self.conductor.instance_get_all_by_filters(self.context, filters,
'fake-key', 'fake-sort')
@@ -679,7 +680,7 @@ class ConductorTestCase(_BaseTestCase, test.TestCase):
self.mox.StubOutWithMock(db, 'instance_get_all_by_host')
self.mox.StubOutWithMock(db, 'instance_get_all_by_host_and_node')
db.instance_get_all_by_host(self.context.elevated(),
- 'host').AndReturn('result')
+ 'host', None).AndReturn('result')
db.instance_get_all_by_host_and_node(self.context.elevated(), 'host',
'node').AndReturn('result')
self.mox.ReplayAll()
@@ -826,7 +827,8 @@ class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):
filters = {'foo': 'bar'}
self.mox.StubOutWithMock(db, 'instance_get_all_by_filters')
db.instance_get_all_by_filters(self.context, filters,
- 'fake-key', 'fake-sort')
+ 'fake-key', 'fake-sort',
+ columns_to_join=None)
self.mox.ReplayAll()
self.conductor.instance_get_all_by_filters(self.context, filters,
'fake-key', 'fake-sort')
@@ -973,7 +975,8 @@ class ConductorAPITestCase(_BaseTestCase, test.TestCase):
self.mox.StubOutWithMock(db, 'instance_get_all_by_filters')
db.instance_get_all(self.context)
db.instance_get_all_by_filters(self.context, {'name': 'fake-inst'},
- 'updated_at', 'asc')
+ 'updated_at', 'asc',
+ columns_to_join=None)
self.mox.ReplayAll()
self.conductor.instance_get_all(self.context)
self.conductor.instance_get_all_by_filters(self.context,
@@ -1049,14 +1052,20 @@ class ConductorAPITestCase(_BaseTestCase, test.TestCase):
result = self.conductor.service_update(self.context, {'id': ''}, {})
self.assertEqual(result, 'fake-result')
- def test_instance_get_all_by_host(self):
- self._test_stubbed('instance_get_all_by_host',
- self.context.elevated(), 'host')
-
def test_instance_get_all_by_host_and_node(self):
self._test_stubbed('instance_get_all_by_host_and_node',
self.context.elevated(), 'host', 'node')
+ def test_instance_get_all_by_host(self):
+ self.mox.StubOutWithMock(db, 'instance_get_all_by_host')
+ self.mox.StubOutWithMock(db, 'instance_get_all_by_host_and_node')
+ db.instance_get_all_by_host(self.context.elevated(), 'host',
+ None).AndReturn('fake-result')
+ self.mox.ReplayAll()
+ result = self.conductor.instance_get_all_by_host(self.context,
+ 'host')
+ self.assertEqual(result, 'fake-result')
+
def test_ping(self):
timeouts = []
calls = dict(count=0)