This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
commit 70bdc86128c01cbc7da77aa82c9e40188e257a2d
Author: Nir Soffer <nsoffer(a)redhat.com>
Date: Sat Jan 13 00:34:04 2018 +0200
Extract start_sanlock_deamon() helper
This will allow testing sanlock lockfile by trying to start multiple
instances, and also makes the fixture code cleaner.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/daemon_test.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tests/daemon_test.py b/tests/daemon_test.py
index a3d299f..5c8c3c8 100644
--- a/tests/daemon_test.py
+++ b/tests/daemon_test.py
@@ -17,8 +17,7 @@ ENV["SANLOCK_RUN_DIR"] = "/tmp/sanlock"
ENV["SANLOCK_PRIVILEGED"] = "0"
-(a)pytest.fixture(scope="session")
-def sanlock_daemon():
+def start_sanlock_daemon():
cmd = [SANLOCK, "daemon",
# no fork and print all logging to stderr
"-D",
@@ -31,7 +30,12 @@ def sanlock_daemon():
# run as current user instead of "sanlock"
"-U", ENV["USER"],
"-G", ENV["USER"]]
- p = subprocess.Popen(cmd, env=ENV)
+ return subprocess.Popen(cmd, env=ENV)
+
+
+(a)pytest.fixture(scope="session")
+def sanlock_daemon():
+ p = start_sanlock_daemon()
try:
yield
finally:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.