]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-05-RLIMITS/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-05-RLIMITS / test.sh
CommitLineData
68a8f177 1#!/bin/bash
818567fc 2set -e
68a8f177
EV
3TEST_DESCRIPTION="Resource limits-related tests"
4
5. $TEST_BASE_DIR/test-functions
6
68a8f177 7test_setup() {
ec4cab49 8 create_empty_image_rootdir
68a8f177
EV
9
10 # Create what will eventually be our root filesystem onto an overlay
11 (
12 LOG_LEVEL=5
13 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
14
15 setup_basic_environment
51fa8591 16 mask_supporting_services
056ae881 17
68a8f177
EV
18 cat >$initdir/etc/systemd/system.conf <<EOF
19[Manager]
20DefaultLimitNOFILE=10000:16384
21EOF
22
23 # setup the testsuite service
24 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
25[Unit]
26Description=Testsuite service
68a8f177
EV
27
28[Service]
29ExecStart=/test-rlimits.sh
30Type=oneshot
31EOF
32
33 cp test-rlimits.sh $initdir/
34
35 setup_testsuite
cc469c3d 36 )
68a8f177 37 setup_nspawn_root
68a8f177
EV
38}
39
68a8f177 40do_test "$@"