]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-05-RLIMITS/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-05-RLIMITS / test.sh
1 #!/bin/bash
2 set -e
3 TEST_DESCRIPTION="Resource limits-related tests"
4
5 . $TEST_BASE_DIR/test-functions
6
7 test_setup() {
8 create_empty_image_rootdir
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
16 mask_supporting_services
17
18 cat >$initdir/etc/systemd/system.conf <<EOF
19 [Manager]
20 DefaultLimitNOFILE=10000:16384
21 EOF
22
23 # setup the testsuite service
24 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
25 [Unit]
26 Description=Testsuite service
27
28 [Service]
29 ExecStart=/test-rlimits.sh
30 Type=oneshot
31 EOF
32
33 cp test-rlimits.sh $initdir/
34
35 setup_testsuite
36 )
37 setup_nspawn_root
38 }
39
40 do_test "$@"