From 85a3902437516488c9f76ff348c053499f10488a Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Jan 08 2018 19:35:26 +0000 Subject: Run the tests from anywhere in the tree 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 --- 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):