summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2011-10-15 16:15:13 +0100
committerMark McLoughlin <markmc@redhat.com>2011-10-18 06:24:11 +0100
commit4eeb0b96fcd37b6ec8a3e6c2db22e014b326b9c2 (patch)
tree084d680255a6f89be6d2a96b4f4f3d95888ff4b7
parent821fae95d6aa86ffd14a4e48254da8ee7392c042 (diff)
downloadnova-4eeb0b96fcd37b6ec8a3e6c2db22e014b326b9c2.tar.gz
nova-4eeb0b96fcd37b6ec8a3e6c2db22e014b326b9c2.tar.xz
nova-4eeb0b96fcd37b6ec8a3e6c2db22e014b326b9c2.zip
Chain up to superclass tearDown in ServerActionsTest
I noticed that HostTestCase was failing if run on its own because allow_admin_api wasn't set - it worked fine when the full suite was run because the flag was being leaked from ServerActionsTest. Change-Id: I9072f84f017125536d1f261165c44413964f5708
-rw-r--r--nova/tests/api/openstack/test_server_actions.py1
-rw-r--r--nova/tests/test_hosts.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_server_actions.py b/nova/tests/api/openstack/test_server_actions.py
index 516a95094..747d2a2f6 100644
--- a/nova/tests/api/openstack/test_server_actions.py
+++ b/nova/tests/api/openstack/test_server_actions.py
@@ -136,6 +136,7 @@ class ServerActionsTest(test.TestCase):
def tearDown(self):
self.stubs.UnsetAll()
+ super(ServerActionsTest, self).tearDown()
def test_server_bad_body(self):
body = {}
diff --git a/nova/tests/test_hosts.py b/nova/tests/test_hosts.py
index a724db9da..becc74cdd 100644
--- a/nova/tests/test_hosts.py
+++ b/nova/tests/test_hosts.py
@@ -94,14 +94,17 @@ class HostTestCase(test.TestCase):
self.assertEqual(result_c2["status"], "disabled")
def test_host_startup(self):
+ self.flags(allow_admin_api=True)
result = self.controller.startup(self.req, "host_c1")
self.assertEqual(result["power_action"], "startup")
def test_host_shutdown(self):
+ self.flags(allow_admin_api=True)
result = self.controller.shutdown(self.req, "host_c1")
self.assertEqual(result["power_action"], "shutdown")
def test_host_reboot(self):
+ self.flags(allow_admin_api=True)
result = self.controller.reboot(self.req, "host_c1")
self.assertEqual(result["power_action"], "reboot")