From: Yu Watanabe Date: Thu, 24 Jul 2025 17:46:07 +0000 (+0900) Subject: integration-test: show journalctl command for showing saved journal when TEST_SAVE_JO... X-Git-Tag: v258-rc2~91^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82693960784427ad8583e6a7570c2f4834a6d397;p=thirdparty%2Fsystemd.git integration-test: show journalctl command for showing saved journal when TEST_SAVE_JOURNAL=1 --- diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index 999fef9edc3..34908e7ed90 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -660,7 +660,12 @@ def main() -> None: journal_file = Path(shutil.move(journal_file, dst)) if shell or (result.returncode in (args.exit_code, 77) and not coredumps and not sanitizer): - exit(0 if shell or result.returncode == args.exit_code else 77) + exit_code = 0 if shell or result.returncode == args.exit_code else 77 + exit_str = 'succeeded' if exit_code == 0 else 'skipped' + else: + # 0 also means we failed so translate that to a non-zero exit code to mark the test as failed. + exit_code = result.returncode or 1 + exit_str = 'failed' if journal_file.exists(): ops = [] @@ -678,10 +683,11 @@ def main() -> None: ops += [f'journalctl --file {journal_file} --no-hostname -o short-monotonic -u {args.unit} -p info'] - print(f'Test failed, relevant logs can be viewed with: \n\n{(" && ".join(ops))}\n', file=sys.stderr) + print( + f'Test {exit_str}, relevant logs can be viewed with: \n\n{(" && ".join(ops))}\n', file=sys.stderr + ) - # 0 also means we failed so translate that to a non-zero exit code to mark the test as failed. - exit(result.returncode or 1) + exit(exit_code) if __name__ == '__main__':