]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-32-OOMPOLICY/test.sh
test: add function to reduce copied setup boilerplate
[thirdparty/systemd.git] / test / TEST-32-OOMPOLICY / test.sh
1 #!/bin/bash
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_rootdir
12
13 (
14 LOG_LEVEL=5
15 eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
16
17 setup_basic_environment
18 mask_supporting_services
19
20 # setup the testsuite service
21 cat >$initdir/etc/systemd/system/testsuite.service <<EOF
22 [Unit]
23 Description=Testsuite service
24
25 [Service]
26 ExecStart=/testsuite.sh
27 Type=oneshot
28 MemoryAccounting=yes
29 EOF
30 cp testsuite.sh $initdir/
31
32 setup_testsuite
33 )
34 }
35
36 do_test "$@"