]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-18.sh
TEST-18-FAILUREACTION: Exit with 123 on success
[thirdparty/systemd.git] / test / units / testsuite-18.sh
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eux
4 set -o pipefail
5
6 systemd-run --wait -p FailureAction=poweroff true
7 (! systemd-run --wait -p SuccessAction=poweroff false)
8
9 if ! test -f /firstphase ; then
10 echo OK >/firstphase
11 systemd-run --wait -p SuccessAction=reboot true
12 else
13 echo OK >/testok
14 systemd-run --wait -p FailureAction=exit -p FailureActionExitStatus=123 false
15 fi
16
17 sleep infinity