diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:18:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:18:34 +0000 |
commit | 67497cedb2f732b3445ecdc0d09b881f9c69f852 (patch) | |
tree | b7197679acca419c7ddc0300873e19141d5fae3e /test/integration-test-wrapper.py | |
parent | Adding debian version 256.1-2. (diff) | |
download | systemd-67497cedb2f732b3445ecdc0d09b881f9c69f852.tar.xz systemd-67497cedb2f732b3445ecdc0d09b881f9c69f852.zip |
Merging upstream version 256.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration-test-wrapper.py')
-rwxr-xr-x | test/integration-test-wrapper.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index b6a16aa..743a14c 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -61,6 +61,8 @@ def main(): print(f"TEST_NO_QEMU=1, skipping {args.name}", file=sys.stderr) exit(77) + keep_journal = os.getenv("TEST_SAVE_JOURNAL", "fail") + name = args.name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") dropin = textwrap.dedent( @@ -101,6 +103,12 @@ def main(): journal_file = (args.meson_build_dir / (f"test/journal/{name}.journal")).absolute() journal_file.unlink(missing_ok=True) else: + dropin += textwrap.dedent( + """ + [Unit] + Wants=multi-user.target + """ + ) journal_file = None cmd = [ @@ -152,11 +160,10 @@ def main(): result = subprocess.run(cmd) - if result.returncode in (args.exit_code, 77): - # Do not keep journal files for tests that don't fail. - if journal_file: - journal_file.unlink(missing_ok=True) + if journal_file and (keep_journal == "0" or (result.returncode in (args.exit_code, 77) and keep_journal == "fail")): + journal_file.unlink(missing_ok=True) + if result.returncode in (args.exit_code, 77): exit(0 if result.returncode == args.exit_code else 77) if journal_file: |