]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: xlate-test: Fix for 'make distcheck'
authorPhil Sutter <phil@nwl.cc>
Wed, 6 Nov 2024 15:42:46 +0000 (16:42 +0100)
committerPhil Sutter <phil@nwl.cc>
Wed, 6 Nov 2024 16:41:55 +0000 (17:41 +0100)
Similar problem as with the other suites: The build directory does not
contain test cases, only build results.

Signed-off-by: Phil Sutter <phil@nwl.cc>
xlate-test.py

index b6a78bb250e27d4091b7b9648285938fbd9da590..1c8cfe71ffd46eb6bf898c7232a4da074799f7c4 100755 (executable)
@@ -188,8 +188,10 @@ def run_test(name, payload):
 
 def load_test_files():
     test_files = total_tests = total_passed = total_error = total_failed = 0
-    tests = sorted(os.listdir("extensions"))
-    for test in ['extensions/' + f for f in tests if f.endswith(".txlate")]:
+    tests_path = os.path.join(os.path.dirname(sys.argv[0]), "extensions")
+    tests = sorted(os.listdir(tests_path))
+    for test in [os.path.join(tests_path, f)
+                 for f in tests if f.endswith(".txlate")]:
         with open(test, "r") as payload:
             tests, passed, failed, errors = run_test(test, payload)
             test_files += 1