diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-04 15:20:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-04 15:20:00 +0100 |
commit | 71bb9594e9b01d669cd527f4e581c1f22605004b (patch) | |
tree | 77953ec2a3d9fc935d317868601c2ab18d3d3b21 /test | |
parent | a4eba5d8cfaabbd87687c651fcdd06df9e267931 (diff) | |
parent | 12ab94a1e4961a39c32efb60b71866ab588d3ea2 (diff) | |
download | systemd-71bb9594e9b01d669cd527f4e581c1f22605004b.tar.gz |
Merge pull request #21030 from DaanDeMeyer/path-skipped
core: Propagate condition failed state from service to path unit.
Diffstat (limited to 'test')
-rw-r--r-- | test/testsuite-63.units/test63.service | 2 | ||||
-rw-r--r-- | test/units/testsuite-10.service | 2 | ||||
-rw-r--r-- | test/units/testsuite-63.service | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/test/testsuite-63.units/test63.service b/test/testsuite-63.units/test63.service index 0253943f0c..1a8721d82c 100644 --- a/test/testsuite-63.units/test63.service +++ b/test/testsuite-63.units/test63.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -ConditionPathExists=!/tmp/nonexistent +ConditionPathExists=/tmp/nonexistent [Service] ExecStart=true diff --git a/test/units/testsuite-10.service b/test/units/testsuite-10.service index 94eeb20781..1040763276 100644 --- a/test/units/testsuite-10.service +++ b/test/units/testsuite-10.service @@ -13,5 +13,5 @@ ExecStart=-socat -T20 OPEN:test.file UNIX-CONNECT:/run/test.ctl # systemd enough time even on slower machines, to reach the trigger limit. ExecStart=sleep 10 ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P ActiveState)" = failed' -ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P Result)" = trigger-limit-hit' +ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P Result)" = service-condition-failed' ExecStart=sh -x -c 'echo OK >/testok' diff --git a/test/units/testsuite-63.service b/test/units/testsuite-63.service index 0a8d143be9..616d8a6acc 100644 --- a/test/units/testsuite-63.service +++ b/test/units/testsuite-63.service @@ -8,10 +8,10 @@ Type=oneshot ExecStart=rm -f /tmp/nonexistent ExecStart=systemctl start test63.path ExecStart=touch /tmp/test63 -# Make sure systemd has sufficient time to hit the start limit for test63.service. ExecStart=sleep 2 -ExecStart=sh -x -c 'test "$(systemctl show test63.service -P ActiveState)" = failed' -ExecStart=sh -x -c 'test "$(systemctl show test63.service -P Result)" = start-limit-hit' +# Ensure both the service and the corresponding path unit go inactive due to the failed condition check. +ExecStart=sh -x -c 'test "$(systemctl show test63.service -P ActiveState)" = inactive' +ExecStart=sh -x -c 'test "$(systemctl show test63.service -P Result)" = success' ExecStart=sh -x -c 'test "$(systemctl show test63.path -P ActiveState)" = failed' -ExecStart=sh -x -c 'test "$(systemctl show test63.path -P Result)" = unit-start-limit-hit' +ExecStart=sh -x -c 'test "$(systemctl show test63.path -P Result)" = unit-condition-failed' ExecStart=sh -x -c 'echo OK >/testok' |