]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Only plug in integration-test-setup.sh in interactive mode 35937/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Jan 2025 10:28:15 +0000 (11:28 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Jan 2025 10:28:15 +0000 (11:28 +0100)
If we're not running interactively, there's no point in the features
from integration-test-setup.sh which are intended for interactive
development and debugging so lets skip adding it in that case.

test/integration-test-wrapper.py
test/test.service.in

index ef6df8840f50dad4fc12a64c782c971284199a1a..5fa0325b889e571d23a996b6b087d9cbe2cd3f70 100755 (executable)
@@ -459,6 +459,15 @@ def main() -> None:
             """
         )
 
+    if sys.stderr.isatty():
+        dropin += textwrap.dedent(
+            """
+            [Service]
+            ExecStartPre=/usr/lib/systemd/tests/testdata/integration-test-setup.sh setup
+            ExecStopPost=/usr/lib/systemd/tests/testdata/integration-test-setup.sh finalize
+            """
+        )
+
     cmd = [
         args.mkosi,
         '--directory', os.fspath(args.meson_source_dir),
index 6400be07002888e0658894a36fca4277c79e3bfd..75f703698f6875ba3a2006a165866da673f84644 100644 (file)
@@ -7,9 +7,7 @@ Before=getty-pre.target
 
 [Service]
 ExecStartPre=rm -f /failed /testok
-ExecStartPre=/usr/lib/systemd/tests/testdata/integration-test-setup.sh setup
 ExecStart=@command@
-ExecStopPost=/usr/lib/systemd/tests/testdata/integration-test-setup.sh finalize
 Type=oneshot
 MemoryAccounting=@memory-accounting@
 StateDirectory=%N