diff options
author | Dan Streetman <ddstreet@canonical.com> | 2019-08-13 08:05:06 -0400 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-08-25 15:37:51 +0900 |
commit | adcc450f46047a057365658a5f3296b8eddfa8dd (patch) | |
tree | 6f13e9830ad84f85a91acab4062339865021fc47 | |
parent | 84c49ad197d78fb66a6f4d5ac540697ee36b46e1 (diff) | |
download | systemd-adcc450f46047a057365658a5f3296b8eddfa8dd.tar.gz |
test/test-functions: use truncate instead of dd to create testbed image
This avoids unnecessary noise in the stderr logs which dd always produces,
such as:
0+0 records in
0+0 records out
0 bytes copied, 0.000155284 s, 0.0 kB/s
Using truncate should not result in any functional change; the image will
still be created as a sparse file of the size specified.
-rw-r--r-- | test/test-functions | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test-functions b/test/test-functions index 62439e66fb..a8b527b5a6 100644 --- a/test/test-functions +++ b/test/test-functions @@ -543,7 +543,7 @@ create_empty_image() { fi rm -f "$TESTDIR/rootdisk.img" # Create the blank file to use as a root filesystem - dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek="$_size" + truncate -s "${_size}M" "$TESTDIR/rootdisk.img" LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img) [ -b "$LOOPDEV" ] || return 1 echo "LOOPDEV=$LOOPDEV" >> $STATEFILE |