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