Replace 'dd' in tests with use of guestfish 'sparse' command.
authorRichard Jones <rjones@redhat.com>
Tue, 20 Apr 2010 10:04:14 +0000 (11:04 +0100)
committerRichard Jones <rjones@redhat.com>
Tue, 20 Apr 2010 10:04:14 +0000 (11:04 +0100)
'dd' is a very inefficient way to create files.  'truncate' is
better, but unfortunately that command is not available in RHEL 5.
So use the guestfish 'sparse' command instead (which also avoids
allocating disk space).

regressions/rhbz503169c10.sh
regressions/rhbz503169c13.sh
regressions/test-bootbootboot.sh

index 0a32749..a975f69 100755 (executable)
@@ -22,9 +22,9 @@
 set -e
 
 rm -f test1.img
 set -e
 
 rm -f test1.img
-dd if=/dev/zero of=test1.img bs=1024k count=10
 
 
-../fish/guestfish -a test1.img <<EOF
+../fish/guestfish <<EOF
+sparse test1.img 10M
 launch
 part-disk /dev/sda mbr
 mkfs ext2 /dev/sda1
 launch
 part-disk /dev/sda mbr
 mkfs ext2 /dev/sda1
index f7ad9e4..1b19cdf 100755 (executable)
@@ -27,9 +27,9 @@
 set -e
 
 rm -f test1.img
 set -e
 
 rm -f test1.img
-dd if=/dev/zero of=test1.img bs=1024k count=10
 
 
-../fish/guestfish -a test1.img <<EOF
+../fish/guestfish <<EOF
+sparse test1.img 10M
 run
 part-disk /dev/sda mbr
 mkfs ext2 /dev/sda1
 run
 part-disk /dev/sda mbr
 mkfs ext2 /dev/sda1
index 5be15d2..842e41f 100755 (executable)
@@ -24,7 +24,6 @@
 set -e
 
 rm -f test1.img
 set -e
 
 rm -f test1.img
-dd if=/dev/zero of=test1.img bs=1024k count=500
 
 n=10
 if [ -n "$1" ]; then n=$1; fi
 
 n=10
 if [ -n "$1" ]; then n=$1; fi
@@ -33,7 +32,7 @@ export LIBGUESTFS_DEBUG=1
 
 for i in $(seq 1 $n); do
   echo Test boot $i of $n ...
 
 for i in $(seq 1 $n); do
   echo Test boot $i of $n ...
-  ../fish/guestfish -a test1.img run
+  ../fish/guestfish sparse test1.img 500M : run
 done
 
 rm test1.img
 done
 
 rm test1.img