]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
integration-test: show journalctl command for showing saved journal when TEST_SAVE_JO...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Jul 2025 17:46:07 +0000 (02:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 24 Jul 2025 19:54:38 +0000 (04:54 +0900)
test/integration-tests/integration-test-wrapper.py

index 999fef9edc31ccaa95b8203ba17f4fdbaf5c7701..34908e7ed90897b4478ef3f7ce32e36bd31dfb91 100755 (executable)
@@ -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__':