test: move TEST-47-* to static files

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-03-28 11:50:53 +01:00
parent 2c75449a38
commit bdfa9657d0
5 changed files with 20 additions and 44 deletions
+7
View File
@@ -0,0 +1,7 @@
[Unit]
Description=Issue 14566 Repro
[Service]
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
ExecStopPost=/bin/true
KillMode=mixed
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
sleep infinity &
echo $! > /leakedtestpid
wait $!
+6
View File
@@ -0,0 +1,6 @@
[Unit]
Description=TEST-47-ISSUE-14566
[Service]
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -ex
set -o pipefail
systemd-analyze log-level debug
systemd-analyze log-target console
systemctl start testsuite-47-repro
sleep 1
systemctl status testsuite-47-repro
leaked_pid=$(cat /leakedtestpid)
systemctl stop testsuite-47-repro
# Leaked PID will still be around if we're buggy.
# I personally prefer to see 42.
ps -p "$leaked_pid" && exit 42
systemd-analyze log-level info
echo OK > /testok
exit 0