summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-22 16:52:21 +0000
committerGerrit Code Review <review@openstack.org>2013-03-22 16:52:21 +0000
commit4abf480c7ec61e8906ec96da8f78dec336584f98 (patch)
tree3529fef0dd668fd243ad372bf153ced2f19d694a
parenta69e6b873e157adb9e214d01dc8952a7589be366 (diff)
parent723ad7719a21751d8f9fe72787d7713eae58cade (diff)
downloadoslo-4abf480c7ec61e8906ec96da8f78dec336584f98.tar.gz
oslo-4abf480c7ec61e8906ec96da8f78dec336584f98.tar.xz
oslo-4abf480c7ec61e8906ec96da8f78dec336584f98.zip
Merge "lockutils: add a failing unit test"
-rw-r--r--tests/unit/test_lockutils.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/unit/test_lockutils.py b/tests/unit/test_lockutils.py
index e1f0375..ae5dca7 100644
--- a/tests/unit/test_lockutils.py
+++ b/tests/unit/test_lockutils.py
@@ -125,10 +125,8 @@ class LockTestCase(utils.BaseTestCase):
if os.path.exists(tempdir):
shutil.rmtree(tempdir)
- def test_synchronized_externally(self):
+ def _do_test_synchronized_externally(self):
"""We can lock across multiple processes"""
- lock_dir = tempfile.mkdtemp()
- self.config(lock_path=lock_dir)
@lockutils.synchronized('external', 'test-', external=True)
def lock_files(handles_dir):
@@ -176,5 +174,26 @@ class LockTestCase(utils.BaseTestCase):
finally:
if os.path.exists(handles_dir):
shutil.rmtree(handles_dir, ignore_errors=True)
+
+ def test_synchronized_externally(self):
+ lock_dir = tempfile.mkdtemp()
+ self.config(lock_path=lock_dir)
+
+ try:
+ self._do_test_synchronized_externally()
+ finally:
+ if os.path.exists(lock_dir):
+ shutil.rmtree(lock_dir, ignore_errors=True)
+
+ def test_synchronized_externally_lock_dir_not_exist(self):
+ self.skipTest('bug #1107950')
+
+ lock_dir = tempfile.mkdtemp()
+ os.rmdir(lock_dir)
+ self.config(lock_path=lock_dir)
+
+ try:
+ self._do_test_synchronized_externally()
+ finally:
if os.path.exists(lock_dir):
shutil.rmtree(lock_dir, ignore_errors=True)