]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Connect test unit to console when running interactively
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 3 Mar 2025 11:35:11 +0000 (12:35 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Mar 2025 21:28:53 +0000 (21:28 +0000)
When running interactively, let's connect the test unit directly
to the console. This enables adding "bash" anywhere within an
integration test to get a shell within the test environment.

(cherry picked from commit fe7413d1955bbf0f8fe869543c423025a22a4671)

test/integration-test-wrapper.py

index e9c5a295bc455498e83eb21ac003fc2b7613b94e..55eca9f75aa7cbc40cb46c6bb801cf035218cefe 100755 (executable)
@@ -456,6 +456,16 @@ def main() -> None:
             [Unit]
             Wants=multi-user.target getty-pre.target
             Before=getty-pre.target
+
+            [Service]
+            StandardInput=tty
+            StandardOutput=inherit
+            StandardError=inherit
+            TTYReset=yes
+            TTYVHangup=yes
+            IgnoreSIGPIPE=no
+            # bash ignores SIGTERM
+            KillSignal=SIGHUP
             """
         )