Skip to content

Commit

Permalink
Use sparse files for loopback+file configurations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
behlendorf committed Aug 2, 2010
1 parent 858985a commit 5545ade
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions scripts/zpool-config/file-raid0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/file-raid10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/file-raidz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/file-raidz2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/lo-raid0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions scripts/zpool-config/lo-raid10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/lo-raidz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/zpool-config/lo-raidz2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 5545ade

Please sign in to comment.