]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-05.sh
Merge pull request #18863 from keszybz/cmdline-escaping
[thirdparty/systemd.git] / test / units / testsuite-05.sh
1 #!/usr/bin/env bash
2 set -eux
3 set -o pipefail
4
5 P=/run/systemd/system.conf.d
6 mkdir $P
7
8 cat >$P/rlimits.conf <<EOF
9 [Manager]
10 DefaultLimitNOFILE=10000:16384
11 EOF
12
13 systemctl daemon-reload
14
15 [[ "$(systemctl show -P DefaultLimitNOFILESoft)" = "10000" ]]
16 [[ "$(systemctl show -P DefaultLimitNOFILE)" = "16384" ]]
17
18 [[ "$(systemctl show -P LimitNOFILESoft testsuite-05.service)" = "10000" ]]
19 [[ "$(systemctl show -P LimitNOFILE testsuite-05.service)" = "16384" ]]
20
21 # shellcheck disable=SC2016
22 systemd-run --wait -t bash -c '[[ "$(ulimit -n -S)" = "10000" ]]'
23 # shellcheck disable=SC2016
24 systemd-run --wait -t bash -c '[[ "$(ulimit -n -H)" = "16384" ]]'
25
26 touch /testok