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

This commit is contained in:
Mike Yuan
2023-07-05 08:15:35 +08:00
parent 48cb073db8
commit 5db456d065
4 changed files with 33 additions and 0 deletions
@@ -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
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
PropagatesStopTo=sleep-infinity-simple.service
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Sleep infinitely
[Service]
Type=simple
ExecStart=/bin/sleep infinity
+18
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