From 73842b54f7078e699e3107ae3c098bcd63d5a07a Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Thu, 19 Dec 2024 23:26:26 +0100 Subject: [PATCH] regression tests: make loop device size more generous Depending on the system, copying echo to the loop device fails because the echo binary is too large. Especially on systems that have echo be just a symlink to coreutils (e.g. busybox) 16k is just not enough. 2M seems fine on my system, but this might need yet a higher value depending on what coreutils other people actually run. The actual loop device needs to be larger to properly fit the allocated file size. Testing shows 4M is sufficient, but this is basically arbitrary. (cherry picked from commit 1cc2a3bd86c5b6642f483c1da8da48276d694eab) Signed-off-by: John Johansen --- tests/regression/apparmor/file_unbindable_mount.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression/apparmor/file_unbindable_mount.sh b/tests/regression/apparmor/file_unbindable_mount.sh index 96c0cbc4c..bb9c08a0c 100644 --- a/tests/regression/apparmor/file_unbindable_mount.sh +++ b/tests/regression/apparmor/file_unbindable_mount.sh @@ -22,14 +22,14 @@ backing_file="$tmpdir/loop_file" mount_target="$tmpdir/mount_target" mkdir "${mount_target}" -fallocate -l 512K "${backing_file}" +fallocate -l 4M "${backing_file}" mkfs.fat -F 32 "${backing_file}" > /dev/null 2> /dev/null losetup -f "${backing_file}" || fatalerror 'Unable to set up a loop device' loop_device="$(/sbin/losetup -n -O NAME -l -j "${backing_file}")" mount --make-unbindable "${loop_device}" "${mount_target}" -fallocate -l 16K "${mount_target}/a_file" +fallocate -l 2M "${mount_target}/a_file" # echo is also a builtin, making things a bit more complicated cp "$(type -P echo)" "${mount_target}/echo"