From: Martin Vidner Date: Wed, 27 Nov 2019 09:28:11 +0000 (+0100) Subject: Use a sparse file for the filesystem image X-Git-Tag: v0.8.6~4^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97faf0c72bba35ec4e1f0019f7034b85bd630ceb;p=thirdparty%2Fsnapper.git Use a sparse file for the filesystem image --- diff --git a/testsuite-real/setup-and-run-all b/testsuite-real/setup-and-run-all index d27119f8..f3edd0dc 100755 --- a/testsuite-real/setup-and-run-all +++ b/testsuite-real/setup-and-run-all @@ -10,9 +10,9 @@ fi CFG=testsuite MNT=/"$CFG" -#CFG=scratch2 -#MNT=~/"$CFG"-btrfs -IMG="$MNT".img +# $CFG and $MNT are hardcoded in the tests +# but $IMG is not so we can use it to hint at its purpose +IMG="$MNT"-of-snapper.img forget_config() { sed -i -e "/^SNAPPER_CONFIGS=/s/\b${CFG}\b//" /etc/sysconfig/snapper @@ -26,7 +26,8 @@ setup() { echo >&2 "After you inspect the artifacts, run '$0 teardown' to clean up." exit 1 fi - dd if=/dev/zero of="$IMG" bs=1M count=110 + # BTRFS requires at least 109MiB; a 150MiB sparse image should be enough + truncate --size=150M "$IMG" LOOP=$(losetup --find) losetup "$LOOP" "$IMG" mkfs.btrfs "$LOOP"