Use sparse files for loopback+file configurations

Using sparse files for the test configurations had atleast three
significant advantages.

1) Actually test sparse files to ensure they work.
2) Drastically reduce required disk space for the regression test
   suite.  This turns out to be fairly important when running the
   test suite in a virtualized environment.
3) Significantly speed of the test suite.  Run time of zconfig.sh
   dropped from 2m:56s to 1m:00s on my test system, zpios-sanity.sh
   nows runs in only 0m:26s.
This commit is contained in:
Brian Behlendorf 2010-07-30 21:40:49 -07:00
parent 858985a46e
commit 5545adeadf
8 changed files with 18 additions and 18 deletions

View File

@ -12,8 +12,8 @@ zpool_create() {
for FILE in ${FILES}; do
msg "Creating ${FILE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
done
msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES}

View File

@ -13,8 +13,8 @@ zpool_create() {
for FILE in ${FILES}; do
msg "Creating ${FILE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
done
msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} \

View File

@ -12,8 +12,8 @@ zpool_create() {
for FILE in ${FILES}; do
msg "Creating ${FILE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
done
msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${FILES}

View File

@ -12,8 +12,8 @@ zpool_create() {
for FILE in ${FILES}; do
msg "Creating ${FILE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
done
msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz2 ${FILES}

View File

@ -14,8 +14,8 @@ zpool_create() {
DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
${LOSETUP} ${DEVICE} ${FILE} ||
die "Error $? creating ${FILE} -> ${DEVICE} loopback"
DEVICES="${DEVICES} ${DEVICE}"

View File

@ -16,8 +16,8 @@ zpool_create() {
DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
${LOSETUP} ${DEVICE} ${FILE} ||
die "Error $? creating ${FILE} -> ${DEVICE} loopback"
DEVICES_M1="${DEVICES_M1} ${DEVICE}"
@ -27,8 +27,8 @@ zpool_create() {
DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
${LOSETUP} ${DEVICE} ${FILE} ||
die "Error $? creating ${FILE} -> ${DEVICE} loopback"
DEVICES_M2="${DEVICES_M2} ${DEVICE}"

View File

@ -14,8 +14,8 @@ zpool_create() {
DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
${LOSETUP} ${DEVICE} ${FILE} ||
die "Error $? creating ${FILE} -> ${DEVICE} loopback"
DEVICES="${DEVICES} ${DEVICE}"

View File

@ -14,8 +14,8 @@ zpool_create() {
DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
die "Error $? creating ${FILE}"
dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
&>/dev/null || die "Error $? creating ${FILE}"
${LOSETUP} ${DEVICE} ${FILE} ||
die "Error $? creating ${FILE} -> ${DEVICE} loopback"
DEVICES="${DEVICES} ${DEVICE}"