]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: terminate the test containers cleanly on SIGTERM
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 5 Nov 2025 17:12:39 +0000 (18:12 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 6 Nov 2025 23:38:13 +0000 (23:38 +0000)
So they exit with 0 instead of 143 when we call `machinectl terminate`
on them.

(cherry picked from commit 79a93bb7f52ce71b9d5027e640f59c0f08fbbbcc)

test/units/TEST-13-NSPAWN.machined.sh

index 76db239f916a2d0a2d189abd249f56b1aa89fb57..304435d721ebe24bb064a1da37ae479f38de05b9 100755 (executable)
@@ -50,6 +50,7 @@ trap 'touch /terminate; kill 0' RTMIN+3
 trap 'touch /poweroff' RTMIN+4
 trap 'touch /reboot' INT
 trap 'touch /trap' TRAP
+trap 'exit 0' TERM
 trap 'kill $PID' EXIT
 
 # We need to wait for the sleep process asynchronously in order to allow
@@ -327,6 +328,7 @@ ip address add 192.0.2.1/24 dev hoge
 PID=0
 
 trap 'kill 0' RTMIN+3
+trap 'exit 0' TERM
 trap 'kill $PID' EXIT
 
 # We need to wait for the sleep process asynchronously in order to allow