]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-05-RLIMITS/test.sh
test: Factorize common integration test functions (#6540)
[thirdparty/systemd.git] / test / TEST-05-RLIMITS / test.sh
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4 TEST_DESCRIPTION="Resource limits-related tests"
5
6 . $TEST_BASE_DIR/test-functions
7
8 test_setup() {
9 create_empty_image
10 mkdir -p $TESTDIR/root
11 mount ${LOOPDEV}p1 $TESTDIR/root
12
13 # Create what will eventually be our root filesystem onto an overlay
14 (
15 LOG_LEVEL=5
16 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
17
18 setup_basic_environment
19
20 cat >$initdir/etc/systemd/system.conf <<EOF
21 [Manager]
22 DefaultLimitNOFILE=10000:16384
23 EOF
24
25 # setup the testsuite service
26 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
27 [Unit]
28 Description=Testsuite service
29 After=multi-user.target
30
31 [Service]
32 ExecStart=/test-rlimits.sh
33 Type=oneshot
34 EOF
35
36 cp test-rlimits.sh $initdir/
37
38 setup_testsuite
39 ) || return 1
40 setup_nspawn_root
41
42 ddebug "umount $TESTDIR/root"
43 umount $TESTDIR/root
44 }
45
46 do_test "$@"