]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/units/testsuite-05.sh
tests: add spdx headers to scripts and Makefiles
[thirdparty/systemd.git] / test / units / testsuite-05.sh
CommitLineData
ed024e1d 1#!/usr/bin/env bash
7b3cec95 2# SPDX-License-Identifier: LGPL-2.1-or-later
084575ff 3set -eux
ed024e1d
ZJS
4set -o pipefail
5
6P=/run/systemd/system.conf.d
7mkdir $P
8
9cat >$P/rlimits.conf <<EOF
10[Manager]
11DefaultLimitNOFILE=10000:16384
12EOF
13
14systemctl daemon-reload
15
5522e628
ZJS
16[[ "$(systemctl show -P DefaultLimitNOFILESoft)" = "10000" ]]
17[[ "$(systemctl show -P DefaultLimitNOFILE)" = "16384" ]]
ed024e1d 18
5522e628
ZJS
19[[ "$(systemctl show -P LimitNOFILESoft testsuite-05.service)" = "10000" ]]
20[[ "$(systemctl show -P LimitNOFILE testsuite-05.service)" = "16384" ]]
ed024e1d 21
84031b5d 22# shellcheck disable=SC2016
ed024e1d 23systemd-run --wait -t bash -c '[[ "$(ulimit -n -S)" = "10000" ]]'
84031b5d 24# shellcheck disable=SC2016
ed024e1d
ZJS
25systemd-run --wait -t bash -c '[[ "$(ulimit -n -H)" = "16384" ]]'
26
27touch /testok