From: Nir Soffer <nsoffer(a)redhat.com>
We locate the sanlock executable using the path of the test module,
instead of assuming that the tests are run from the root of the tree.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/direct_test.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/direct_test.py b/tests/direct_test.py
index b9966f3..3536f5e 100644
--- a/tests/direct_test.py
+++ b/tests/direct_test.py
@@ -3,10 +3,12 @@ Test sanlock direct options.
"""
import io
+import os
import struct
import subprocess
-SANLOCK = "src/sanlock"
+tests_dir = os.path.dirname(__file__)
+SANLOCK = os.path.join(tests_dir, os.pardir, "src", "sanlock")
def test_init_lockspace(tmpdir):
--
2.9.5