Changeset View
Changeset View
Standalone View
Standalone View
sbin/bectl/tests/bectl_test.sh
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | bectl_create_setup() | ||||
zpool=$1 | zpool=$1 | ||||
disk=$2 | disk=$2 | ||||
mnt=$3 | mnt=$3 | ||||
# Sanity check to make sure `make_zpool_name` succeeded | # Sanity check to make sure `make_zpool_name` succeeded | ||||
atf_check test -n "$zpool" | atf_check test -n "$zpool" | ||||
kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" | kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" | ||||
if ! getconf MIN_HOLE_SIZE "$(pwd)"; then | |||||
echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ | |||||
"probably not supported by file system" | |||||
mount | |||||
atf_skip "Test's work directory does not support sparse files;" \ | |||||
"try with a different TMPDIR?" | |||||
fi | |||||
atf_check mkdir -p ${mnt} | atf_check mkdir -p ${mnt} | ||||
atf_check truncate -s 1G ${disk} | atf_check truncate -s 1G ${disk} | ||||
atf_check zpool create -R ${mnt} ${zpool} ${disk} | atf_check zpool create -R ${mnt} ${zpool} ${disk} | ||||
atf_check zfs create -o mountpoint=none ${zpool}/ROOT | atf_check zfs create -o mountpoint=none ${zpool}/ROOT | ||||
atf_check zfs create -o mountpoint=/ -o canmount=noauto \ | atf_check zfs create -o mountpoint=/ -o canmount=noauto \ | ||||
${zpool}/ROOT/default | ${zpool}/ROOT/default | ||||
} | } | ||||
bectl_create_deep_setup() | bectl_create_deep_setup() | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |