]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-40.sh
scope: on unified, make sure to unwatch all PIDs once they've been moved to the cgrou...
[thirdparty/systemd.git] / test / units / testsuite-40.sh
1 #!/usr/bin/env bash
2 set -ex
3 set -o pipefail
4
5 systemd-analyze log-level debug
6 systemd-analyze log-target console
7
8 declare -A property
9
10 property[1_one]=ExecCondition
11 property[2_two]=ExecStartPre
12 property[3_three]=ExecStart
13 property[4_four]=ExecStartPost
14 property[5_five]=ExecReload
15 property[6_six]=ExecStop
16 property[7_seven]=ExecStopPost
17
18 # These should all get upgraded to the corresponding Ex property as the non-Ex variant
19 # does not support the ":" prefix (no-env-expand).
20 for c in "${!property[@]}"; do
21 systemd-run --unit="$c" -r -p "Type=oneshot" -p "${property[$c]}=:/bin/echo \${$c}" /bin/true
22 systemctl show -p "${property[$c]}" "$c" | grep -F "path=/bin/echo ; argv[]=/bin/echo \${$c} ; ignore_errors=no"
23 systemctl show -p "${property[$c]}Ex" "$c" | grep -F "path=/bin/echo ; argv[]=/bin/echo \${$c} ; flags=no-env-expand"
24 done
25
26 declare -A property_ex
27
28 property_ex[1_one_ex]=ExecConditionEx
29 property_ex[2_two_ex]=ExecStartPreEx
30 property_ex[3_three_ex]=ExecStartEx
31 property_ex[4_four_ex]=ExecStartPostEx
32 property_ex[5_five_ex]=ExecReloadEx
33 property_ex[6_six_ex]=ExecStopEx
34 property_ex[7_seven_ex]=ExecStopPostEx
35
36 for c in "${!property_ex[@]}"; do
37 systemd-run --unit="$c" -r -p "Type=oneshot" -p "${property_ex[$c]}=:/bin/echo \${$c}" /bin/true
38 systemctl show -p "${property_ex[$c]%??}" "$c" | grep -F "path=/bin/echo ; argv[]=/bin/echo \${$c} ; ignore_errors=no"
39 systemctl show -p "${property_ex[$c]}" "$c" | grep -F "path=/bin/echo ; argv[]=/bin/echo \${$c} ; flags=no-env-expand"
40 done
41
42 systemd-analyze log-level info
43
44 echo OK > /testok
45
46 exit 0