1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

test: add test cases for issue #26839 in TEST-03-JOBS

This commit is contained in:
Mike Yuan 2023-03-16 16:23:17 +08:00
parent 48cb073db8
commit 5db456d065
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3
4 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Requires=sleep-infinity-simple.service
After=sleep-infinity-simple.service
PropagatesStopTo=sleep-infinity-simple.service

View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
PropagatesStopTo=sleep-infinity-simple.service

View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Sleep infinitely
[Service]
Type=simple
ExecStart=/bin/sleep infinity

View File

@ -3,6 +3,9 @@
set -eux
set -o pipefail
# shellcheck source=test/units/util.sh
. "$(dirname "$0")"/util.sh
# Simple test for that daemon-reexec works in container.
# See: https://github.com/systemd/systemd/pull/23883
systemctl daemon-reexec
@ -127,4 +130,19 @@ for i in {0..19}; do
systemctl start "transaction-cycle$i.service"
done
# Test PropagatesStopTo= when restart (issue #26839)
systemctl start propagatestopto-and-pullin.target
systemctl --quiet is-active propagatestopto-and-pullin.target
systemctl restart propagatestopto-and-pullin.target
systemctl --quiet is-active propagatestopto-and-pullin.target
systemctl --quiet is-active sleep-infinity-simple.service
systemctl start propagatestopto-only.target
systemctl --quiet is-active propagatestopto-only.target
systemctl --quiet is-active sleep-infinity-simple.service
systemctl restart propagatestopto-only.target
assert_rc 3 systemctl --quiet is-active sleep-infinity-simple.service
touch /testok