summaryrefslogtreecommitdiffstats
path: root/test/TEST-55-OOMD/test.sh
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2021-04-22 16:26:25 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-04-23 14:36:14 +0200
commit6f47e45c67ad6a6b1a86ad631cd985c7301fed61 (patch)
tree3c335322a037ac1ab1c59f0e6a14439abe873ad1 /test/TEST-55-OOMD/test.sh
parentlogind:add missing equal sign (diff)
downloadsystemd-6f47e45c67ad6a6b1a86ad631cd985c7301fed61.tar.xz
systemd-6f47e45c67ad6a6b1a86ad631cd985c7301fed61.zip
test: configure swap for TEST-55-OOMD
oomd works way better with swap, so let's make the test less flaky by configuring a swap device for it. This also allows us to drop the ugly `cat`s from the load-generating script.
Diffstat (limited to 'test/TEST-55-OOMD/test.sh')
-rwxr-xr-xtest/TEST-55-OOMD/test.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/TEST-55-OOMD/test.sh b/test/TEST-55-OOMD/test.sh
index afc6706e32..9f7a11aea4 100755
--- a/test/TEST-55-OOMD/test.sh
+++ b/test/TEST-55-OOMD/test.sh
@@ -2,10 +2,23 @@
set -e
TEST_DESCRIPTION="systemd-oomd Memory Pressure Test"
+IMAGE_NAME="oomd"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
+test_append_files() {
+ # Create a swap device
+ (
+ mkswap "${LOOPDEV:?}p2"
+ dracut_install swapon swapoff
+
+ cat >>"${initdir:?}/etc/fstab" <<EOF
+UUID=$(blkid -o value -s UUID "${LOOPDEV}p2") none swap defaults 0 0
+EOF
+ )
+}
+
check_result_nspawn() {
local workspace="${1:?}"
local ret=1