1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-20 10:50:12 +03:00
Frantisek Sumsal 3b21fe1894 test: "modernize" TEST-55-OOMD's init
(cherry picked from commit 7e2bf4c5ee871f797c853d8b6474d4d379dad8e2)
(cherry picked from commit 6cd6d89469da4340aae8b51600df8027186c49c5)
(cherry picked from commit 03efc2b9295f71f6b6e7fc894787f9206119ec89)
2024-02-28 10:29:35 +00:00

28 lines
582 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="systemd-oomd Memory Pressure Test"
IMAGE_NAME="oomd"
# Need to set up swap
TEST_NO_NSPAWN=1
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
test_append_files() {
local workspace="${1:?}"
image_install mkswap swapon swapoff stress
image_install -o btrfs
mkdir -p "${workspace:?}/etc/systemd/system/init.scope.d/"
cat >"${workspace:?}/etc/systemd/system/init.scope.d/test-55-oomd.conf" <<EOF
[Scope]
MemoryHigh=10G
EOF
}
do_test "$@" 55