test: move TEST-47-* to static files
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Issue 14566 Repro
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
ExecStopPost=/bin/true
|
||||
KillMode=mixed
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sleep infinity &
|
||||
echo $! > /leakedtestpid
|
||||
wait $!
|
||||
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=TEST-47-ISSUE-14566
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
Type=oneshot
|
||||
Executable
+24
@@ -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
|
||||
Reference in New Issue
Block a user