]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Check stdin for interactivity, not stderr
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 3 Mar 2025 10:44:42 +0000 (11:44 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 3 Mar 2025 10:44:42 +0000 (11:44 +0100)
test/integration-test-wrapper.py

index a87b49bd8b9bb498779d66464768237ed525e145..901695b9707b7ed1cf21ed0687e5d125311c54ff 100755 (executable)
@@ -395,7 +395,7 @@ def main() -> None:
     shell = bool(int(os.getenv('TEST_SHELL', '0')))
     summary = Summary.get(args)
 
-    if shell and not sys.stderr.isatty():
+    if shell and not sys.stdin.isatty():
         print(
             '--interactive must be passed to meson test to use TEST_SHELL=1',
             file=sys.stderr,
@@ -443,7 +443,7 @@ def main() -> None:
 
     journal_file.unlink(missing_ok=True)
 
-    if not sys.stderr.isatty():
+    if not sys.stdin.isatty():
         dropin += textwrap.dedent(
             """
             [Unit]
@@ -458,7 +458,7 @@ def main() -> None:
             """
         )
 
-    if sys.stderr.isatty():
+    if sys.stdin.isatty():
         dropin += textwrap.dedent(
             """
             [Service]
@@ -489,7 +489,7 @@ def main() -> None:
                 '--credential', f'systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}',  # noqa: E501
                 '--credential', f'systemd.unit-dropin.emergency.target={shlex.quote(EMERGENCY_EXIT_DROPIN)}',
             ]
-            if not sys.stderr.isatty()
+            if not sys.stdin.isatty()
             else []
         ),
         '--credential', f'systemd.unit-dropin.{args.unit}={shlex.quote(dropin)}',
@@ -514,13 +514,13 @@ def main() -> None:
                         'systemd.crash_action=poweroff',
                         'loglevel=6',
                     ]
-                    if not sys.stderr.isatty()
+                    if not sys.stdin.isatty()
                     else []
                 ),
             ]
         ),
-        '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else args.storage}",
-        *(['--runtime-build-sources=no', '--register=no'] if not sys.stderr.isatty() else []),
+        '--credential', f"journal.storage={'persistent' if sys.stdin.isatty() else args.storage}",
+        *(['--runtime-build-sources=no', '--register=no'] if not sys.stdin.isatty() else []),
         'vm' if args.vm or os.getuid() != 0 or os.getenv('TEST_PREFER_QEMU', '0') == '1' else 'boot',
     ]  # fmt: skip