This avoids hard coding the path of the directory where the unit tests are
installed.
# SPDX-License-Identifier: LGPL-2.1-or-later
import argparse
-import glob
import os
import pathlib
import subprocess
opts = argument_parser().parse_args()
-tests = glob.glob('/usr/lib/systemd/tests/test-*')
+unittestdir = pathlib.Path(__file__).parent.absolute()
+
+tests = list(unittestdir.glob('test-*'))
if opts.unsafe:
- tests += glob.glob('/usr/lib/systemd/tests/unsafe/test-*')
+ tests += unittestdir.glob('unsafe/test-*')
if not opts.artifact_directory and os.getenv('ARTIFACT_DIRECTORY'):
opts.artifact_directory = os.getenv('ARTIFACT_DIRECTORY')