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:
parent
858985a46e
commit
5545adeadf
|
@ -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}
|
||||
|
|
|
@ -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} \
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue