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