tests: allow passing more than one argument to test-systemd-tmpfiles.py

This makes it easier to run `systemd-tmpfiles` under valgrind.
This commit is contained in:
Evgeny Vereshchagin 2017-12-06 19:04:45 +00:00
parent c7a54cd67b
commit 59ca366cdd
1 changed files with 3 additions and 3 deletions

View File

@ -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