Module: check_mk
Branch: master
Commit: b2246e288c8626475b76d04c7cab83c89c693d9f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2246e288c8626…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 6 14:02:08 2018 +0100
Add quick lock hint for locking
Change-Id: I7b9aee665b0065eac7660953869ad5f536d4163c
---
tests/testlib/__init__.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 556749c..560e6a0 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -203,7 +203,9 @@ class CMKVersion(object):
time.sleep(1)
# Improve the protection against other test runs installing packages
- with lockfile.FileLock("/tmp/cmk-test-install-version.lock"):
+ print("Getting install file lock
(/tmp/cmk-test-install-version.lock)...")
+ with lockfile.FileLock("/tmp/cmk-test-install-version"):
+ print("Have install file lock")
cmd = "sudo /usr/bin/gdebi --non-interactive %s" %
temp_package_path
print(cmd)
sys.stdout.flush()
@@ -441,7 +443,10 @@ class Site(object):
raise Exception("The site %s already exists." % self.id)
if not self.exists():
- with lockfile.FileLock("/tmp/cmk-test-create-site.lock"):
+ print("Getting site create lock
(/tmp/cmk-test-create-site.lock)...")
+ with lockfile.FileLock("/tmp/cmk-test-create-site"):
+ print("Have site create lock")
+
print("[%0.2f] Creating site '%s'" % (time.time(),
self.id))
p = subprocess.Popen(["/usr/bin/sudo",
"/usr/bin/omd",
"-V", self.version.version_directory(),