From: Ruediger Meier Date: Tue, 15 Dec 2015 16:46:58 +0000 (+0100) Subject: tests: always create sparse image files X-Git-Tag: v2.28-rc1~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cb10736e4c5e51075d06ca9a0fc8ff49ac46c7d;p=thirdparty%2Futil-linux.git tests: always create sparse image files This saves about 400M disk I/O and space. Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index f6c4d33ee8..c7e0ded615 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -464,7 +464,8 @@ function ts_image_init { local mib=${1:-"5"} # size in MiBs local img=${2:-"$TS_OUTDIR/${TS_TESTNAME}.img"} - dd if=/dev/zero of="$img" bs=1M count=$mib &> /dev/null + rm -f $img + truncate -s "${mib}M" "$img" echo "$img" return 0 }