]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-32-OOMPOLICY/test.sh
TEST-32-OOMPOLICY: drop unneeded headers
[thirdparty/systemd.git] / test / TEST-32-OOMPOLICY / test.sh
CommitLineData
36869f33 1#!/bin/bash
36869f33
LP
2set -e
3TEST_DESCRIPTION="test OOM killer logic"
4TEST_NO_NSPAWN=1
5
6. $TEST_BASE_DIR/test-functions
7
8UNIFIED_CGROUP_HIERARCHY=yes
9
10test_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]
32Description=Testsuite service
33
34[Service]
35ExecStart=/testsuite.sh
36Type=oneshot
37StandardOutput=tty
38StandardError=tty
39MemoryAccounting=yes
40EOF
41 cp testsuite.sh $initdir/
42
43 setup_testsuite
44 ) || return 1
45
46 ddebug "umount $TESTDIR/root"
47 umount $TESTDIR/root
48}
49
50do_test "$@"