mirror of
https://github.com/openzfs/zfs.git
synced 2025-10-01 11:26:49 +00:00

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.
32 lines
671 B
Bash
32 lines
671 B
Bash
#!/bin/bash
|
|
#
|
|
# 4 File Raid-Z Configuration
|
|
#
|
|
|
|
FILES="/tmp/zpool-vdev0 \
|
|
/tmp/zpool-vdev1 \
|
|
/tmp/zpool-vdev2 \
|
|
/tmp/zpool-vdev3"
|
|
|
|
zpool_create() {
|
|
for FILE in ${FILES}; do
|
|
msg "Creating ${FILE}"
|
|
rm -f ${FILE} || exit 1
|
|
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}
|
|
${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${FILES} || exit 1
|
|
}
|
|
|
|
zpool_destroy() {
|
|
msg ${ZPOOL} destroy ${ZPOOL_NAME}
|
|
${ZPOOL} destroy ${ZPOOL_NAME}
|
|
|
|
for FILE in ${FILES}; do
|
|
msg "Removing ${FILE}"
|
|
rm -f ${FILE} || exit 1
|
|
done
|
|
}
|