]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-19-DELEGATE/test.sh
bb0c5057b21796700383025fbe9435cfae5075d6
[thirdparty/systemd.git] / test / TEST-19-DELEGATE / 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 set -e
5 TEST_DESCRIPTION="test cgroup delegation in the unified hierarchy"
6 TEST_NO_NSPAWN=1
7
8 . $TEST_BASE_DIR/test-functions
9 QEMU_TIMEOUT=180
10 UNIFIED_CGROUP_HIERARCHY=yes
11
12 test_setup() {
13 create_empty_image
14 mkdir -p $TESTDIR/root
15 mount ${LOOPDEV}p1 $TESTDIR/root
16
17 (
18 LOG_LEVEL=5
19 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
20
21 setup_basic_environment
22
23 # mask some services that we do not want to run in these tests
24 ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
25 ln -fs /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
26 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.service
27 ln -fs /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
28 ln -fs /dev/null $initdir/etc/systemd/system/systemd-resolved.service
29 ln -fs /dev/null $initdir/etc/systemd/system/systemd-machined.service
30
31 # setup the testsuite service
32 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
33 [Unit]
34 Description=Testsuite service
35
36 [Service]
37 ExecStart=/bin/bash -x /testsuite.sh
38 Type=oneshot
39 StandardOutput=tty
40 StandardError=tty
41 EOF
42 cp testsuite.sh $initdir/
43
44 setup_testsuite
45 ) || return 1
46
47 ddebug "umount $TESTDIR/root"
48 umount $TESTDIR/root
49 }
50
51 do_test "$@"