test: move TEST-47-* to static files
This commit is contained in:
parent
2c75449a38
commit
bdfa9657d0
|
@ -1,43 +1,6 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
TEST_DESCRIPTION="Test that KillMode=mixed does not leave left over proccesses with ExecStopPost="
|
TEST_DESCRIPTION="Test that KillMode=mixed does not leave left over proccesses with ExecStopPost="
|
||||||
. $TEST_BASE_DIR/test-functions
|
. $TEST_BASE_DIR/test-functions
|
||||||
|
|
||||||
test_setup() {
|
do_test "$@" 47
|
||||||
create_empty_image_rootdir
|
|
||||||
|
|
||||||
(
|
|
||||||
LOG_LEVEL=5
|
|
||||||
eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
|
|
||||||
|
|
||||||
setup_basic_environment
|
|
||||||
mask_supporting_services
|
|
||||||
|
|
||||||
# setup the testsuite service
|
|
||||||
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
|
|
||||||
[Unit]
|
|
||||||
Description=Testsuite service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/testsuite.sh
|
|
||||||
Type=oneshot
|
|
||||||
EOF
|
|
||||||
cat > $initdir/etc/systemd/system/issue_14566_test.service << EOF
|
|
||||||
[Unit]
|
|
||||||
Description=Issue 14566 Repro
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/repro.sh
|
|
||||||
ExecStopPost=/bin/true
|
|
||||||
KillMode=mixed
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cp testsuite.sh $initdir/
|
|
||||||
cp repro.sh $initdir/
|
|
||||||
|
|
||||||
setup_testsuite
|
|
||||||
)
|
|
||||||
setup_nspawn_root
|
|
||||||
}
|
|
||||||
|
|
||||||
do_test "$@"
|
|
||||||
|
|
7
test/units/testsuite-47-repro.service
Normal file
7
test/units/testsuite-47-repro.service
Normal 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
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
sleep infinity &
|
sleep infinity &
|
||||||
echo $! > /leakedtestpid
|
echo $! > /leakedtestpid
|
6
test/units/testsuite-47.service
Normal file
6
test/units/testsuite-47.service
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[Unit]
|
||||||
|
Description=TEST-47-ISSUE-14566
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||||
|
Type=oneshot
|
|
@ -1,17 +1,17 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
systemd-analyze log-level debug
|
systemd-analyze log-level debug
|
||||||
systemd-analyze log-target console
|
systemd-analyze log-target console
|
||||||
|
|
||||||
systemctl start issue_14566_test
|
systemctl start testsuite-47-repro
|
||||||
sleep 1
|
sleep 1
|
||||||
systemctl status issue_14566_test
|
systemctl status testsuite-47-repro
|
||||||
|
|
||||||
leaked_pid=$(cat /leakedtestpid)
|
leaked_pid=$(cat /leakedtestpid)
|
||||||
|
|
||||||
systemctl stop issue_14566_test
|
systemctl stop testsuite-47-repro
|
||||||
|
|
||||||
# Leaked PID will still be around if we're buggy.
|
# Leaked PID will still be around if we're buggy.
|
||||||
# I personally prefer to see 42.
|
# I personally prefer to see 42.
|
Loading…
Reference in a new issue