From beba8f2e1e5f08041d2a9955398a64d92dcc75a0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 3 Jul 2023 12:11:50 +0900 Subject: [PATCH] test: add reproducer for issue #28225 --- test/units/testsuite-58.sh | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/test/units/testsuite-58.sh b/test/units/testsuite-58.sh index 6ddb96d26e3..a170128de91 100755 --- a/test/units/testsuite-58.sh +++ b/test/units/testsuite-58.sh @@ -1021,6 +1021,86 @@ EOF systemd-dissect -U "$imgs/mnt" } +testcase_free_area_calculation() { + local defs imgs output + + if ! command -v mksquashfs >/dev/null; then + echo "Skipping free area calculation test without squashfs." + return + fi + + defs="$(mktemp --directory "/tmp/test-repart.defs.XXXXXXXXXX")" + imgs="$(mktemp --directory "/var/tmp/test-repart.imgs.XXXXXXXXXX")" + # shellcheck disable=SC2064 + trap "rm -rf '$defs' '$imgs'" RETURN + chmod a+rx "$defs" + + # https://github.com/systemd/systemd/issues/28225 + echo "*** free area calculation ***" + + tee "$defs/00-ESP.conf" <