xref: /freebsd/tests/sys/cddl/zfs/include/testenv.ksh (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1. ${STF_SUITE}/include/libtest.kshlib
2. ${STF_SUITE}/include/commands.cfg
3
4# Environment-dependent constants.
5for d in `geom disk list | awk '/Name:/ {print $3}'`; do
6	# Clear the GPT label first to avoid spurious create failures.
7	gpart destroy -F $d >/dev/null 2>&1
8	if gpart create -s gpt $d >/dev/null 2>&1 ; then
9		gpart destroy $d >/dev/null 2>&1 || continue
10		DISKS=("${DISKS[@]}" "/dev/$d") #"$DISKS $d"
11	fi
12	# Don't bother testing any more if we have enough already.
13	# Currently we use at most 5 disks plus 1 for temporary disks.
14	[ ${#DISKS[@]} -eq 6 ] && break
15done
16export KEEP="$(zpool list -H -o name)"
17
18# Pull in constants.
19. ${STF_SUITE}/include/constants.cfg
20