]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: "modernize" TEST-55-OOMD's init 31318/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 16 Feb 2024 12:53:01 +0000 (13:53 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 17 Feb 2024 11:49:44 +0000 (12:49 +0100)
test/TEST-55-OOMD/test.sh

index 9a9cdecf70e72c0e6838ced437657cc7d8cadd8e..5e3096315caf9d24a91b000802db1d1cda11446b 100755 (executable)
@@ -12,18 +12,17 @@ TEST_NO_NSPAWN=1
 . "${TEST_BASE_DIR:?}/test-functions"
 
 test_append_files() {
-    # Create a swap file
-    (
-        image_install mkswap swapon swapoff stress
-        image_install -o btrfs
+    local workspace="${1:?}"
 
-        mkdir -p "${initdir:?}/etc/systemd/system/init.scope.d/"
-        cat >>"${initdir:?}/etc/systemd/system/init.scope.d/test-55-oomd.conf" <<EOF
+    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=infinity
 StartupMemoryHigh=10G
 EOF
-    )
 }
 
 do_test "$@" 55