summaryrefslogtreecommitdiffstats
path: root/tests/test_policy.py
diff options
context:
space:
mode:
authorHenry Nash <henryn@linux.vnet.ibm.com>2013-02-22 16:30:35 +0000
committerHenry Nash <henryn@linux.vnet.ibm.com>2013-02-22 18:42:25 +0000
commit1f7f1bd3c846da88269c0c05a4f20ed4a514e063 (patch)
tree96dff354cb714436a35d75df52649cec9730dc34 /tests/test_policy.py
parent95815708ebc2cacc7d3b1da0602aebc791ac2258 (diff)
downloadkeystone-1f7f1bd3c846da88269c0c05a4f20ed4a514e063.tar.gz
keystone-1f7f1bd3c846da88269c0c05a4f20ed4a514e063.tar.xz
keystone-1f7f1bd3c846da88269c0c05a4f20ed4a514e063.zip
Ensure keystone unittests do not leave CONF.policyfile in bad state
A few of the tests overwrite the name of the policy file (so they can use a temp file instead). However, if it is left that way, subsequent tests that rely on it may fail. A separate patch will look at doing a more comprehensive reset in the setup of test_v3 - ensuring we always start from a completely clean slate for all confirguration parameters. Fixes Bug #1131819 Change-Id: Ibe5ee12f44310de00b12ddd405c83f59b2d840b7
Diffstat (limited to 'tests/test_policy.py')
-rw-r--r--tests/test_policy.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_policy.py b/tests/test_policy.py
index 6895958c..a43c9d3e 100644
--- a/tests/test_policy.py
+++ b/tests/test_policy.py
@@ -32,6 +32,7 @@ CONF = config.CONF
class PolicyFileTestCase(test.TestCase):
def setUp(self):
super(PolicyFileTestCase, self).setUp()
+ self.orig_policy_file = CONF.policy_file
rules.reset()
_unused, self.tmpfilename = tempfile.mkstemp()
self.opt(policy_file=self.tmpfilename)
@@ -40,6 +41,7 @@ class PolicyFileTestCase(test.TestCase):
def tearDown(self):
super(PolicyFileTestCase, self).tearDown()
rules.reset()
+ self.opt(policy_file=self.orig_policy_file)
def test_modified_policy_reloads(self):
action = "example:test"