]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: allow passing more than one argument to test-systemd-tmpfiles.py
authorEvgeny Vereshchagin <evvers@ya.ru>
Wed, 6 Dec 2017 19:04:45 +0000 (19:04 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Wed, 6 Dec 2017 19:30:08 +0000 (19:30 +0000)
This makes it easier to run `systemd-tmpfiles` under valgrind.

src/test/test-systemd-tmpfiles.py

index 309cee23e64aa9278be2e080dc8e8c27156382a3..7e563551cdf8090d1cc9c313b2dcca418f3c1a55 100755 (executable)
@@ -28,12 +28,12 @@ try:
 except AttributeError:
     sys.exit(EXIT_TEST_SKIP)
 
-exe = sys.argv[1]
+exe_with_args = sys.argv[1:]
 
 def test_line(line, *, user, returncode=EX_DATAERR, extra={}):
     args = ['--user'] if user else []
-    print('Running {} {} on {!r}'.format(exe, ' '.join(args), line))
-    c = subprocess.run([exe, '--create', '-'] + args,
+    print('Running {} on {!r}'.format(' '.join(exe_with_args + args), line))
+    c = subprocess.run(exe_with_args + ['--create', '-'] + args,
                        input=line, stdout=subprocess.PIPE, universal_newlines=True,
                        **extra)
     assert c.returncode == returncode, c