]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-05-RLIMITS/test.sh
Merge pull request #12750 from keszybz/tmpfiles-c-copy
[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
9 mkdir -p $TESTDIR/root
10 mount ${LOOPDEV}p1 $TESTDIR/root
11
12 # Create what will eventually be our root filesystem onto an overlay
13 (
14 LOG_LEVEL=5
15 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
16
17 setup_basic_environment
18
19 # mask some services that we do not want to run in these tests
20 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
21 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
22 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
23 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
24 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
25 ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
26
27 cat >$initdir/etc/systemd/system.conf <<EOF
28 [Manager]
29 DefaultLimitNOFILE=10000:16384
30 EOF
31
32 # setup the testsuite service
33 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
34 [Unit]
35 Description=Testsuite service
36
37 [Service]
38 ExecStart=/test-rlimits.sh
39 Type=oneshot
40 EOF
41
42 cp test-rlimits.sh $initdir/
43
44 setup_testsuite
45 )
46 setup_nspawn_root
47
48 ddebug "umount $TESTDIR/root"
49 umount $TESTDIR/root
50 }
51
52 do_test "$@"