summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-22 21:45:34 +0000
committerGerrit Code Review <review@openstack.org>2013-05-22 21:45:34 +0000
commit89df79f865bf87aa0b2f60d7f7cc2349c7acb453 (patch)
treeba4be40d4839b51babb6dc921bbc373a91ee1a4c /nova/tests
parent986fa041a7cb8b85f4b3be47407288c1f71c0972 (diff)
parent616e5d965bd8a2923f00ba4ff194e6a6ee2468cd (diff)
Merge "Make nova-api use servicegroup.API.service_is_up()."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/compute/contrib/test_services.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/compute/contrib/test_services.py b/nova/tests/api/openstack/compute/contrib/test_services.py
index 57dd056ee..387a5eb21 100644
--- a/nova/tests/api/openstack/compute/contrib/test_services.py
+++ b/nova/tests/api/openstack/compute/contrib/test_services.py
@@ -21,6 +21,7 @@ from nova import context
from nova import db
from nova import exception
from nova.openstack.common import timeutils
+from nova.servicegroup.drivers import db as db_driver
from nova import test
from nova.tests.api.openstack import fakes
@@ -202,3 +203,13 @@ class ServicesTest(test.TestCase):
res_dict = self.controller.update(req, "disable", body)
self.assertEqual(res_dict['service']['status'], 'disabled')
+
+ # This test is just to verify that the servicegroup API gets used when
+ # calling this API.
+ def test_services_with_exception(self):
+ def dummy_is_up(self, dummy):
+ raise KeyError()
+
+ self.stubs.Set(db_driver.DbDriver, 'is_up', dummy_is_up)
+ req = FakeRequestWithHostService()
+ self.assertRaises(KeyError, self.controller.index, req)