Commit:
2331d3336a6adf4fc13a3b187e91a5d1b1f7c723
introduced use of lockutils but wasn't setting a lock_path, in the tests.
As a result we were polluting cinder/openstack/ with cinder-xxxx lockfiles.
This patch adds a tempfile and cleanup to the test so we don't leave any
junk behind.
Change-Id: Idd9fee928ff0fcf3f8d1c30ee88c5306b88e290c
+import shutil
+import tempfile
import webob
from cinder import context
class AdminActionsTest(test.TestCase):
def setUp(self):
+ self.tempdir = tempfile.mkdtemp()
super(AdminActionsTest, self).setUp()
self.flags(rpc_backend='cinder.openstack.common.rpc.impl_fake')
+ self.flags(lock_path=self.tempdir)
self.volume_api = volume_api.API()
+ def tearDown(self):
+ shutil.rmtree(self.tempdir)
+
def test_reset_status_as_admin(self):
# admin context
ctx = context.RequestContext('admin', 'fake', True)