diff options
Diffstat (limited to 'tests/sys/cddl/zfs/include/testenv.ksh')
| -rw-r--r-- | tests/sys/cddl/zfs/include/testenv.ksh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/sys/cddl/zfs/include/testenv.ksh b/tests/sys/cddl/zfs/include/testenv.ksh new file mode 100644 index 000000000000..fb464f2feaec --- /dev/null +++ b/tests/sys/cddl/zfs/include/testenv.ksh @@ -0,0 +1,19 @@ +. ${STF_SUITE}/include/libtest.kshlib +. ${STF_SUITE}/include/commands.cfg + +# Environment-dependent constants. +for d in `geom disk list | awk '/Name:/ {print $3}'`; do + # Clear the GPT label first to avoid spurious create failures. + gpart destroy -F $d >/dev/null 2>&1 + if gpart create -s gpt $d >/dev/null 2>&1 ; then + gpart destroy $d >/dev/null 2>&1 || continue + DISKS=("${DISKS[@]}" "/dev/$d") #"$DISKS $d" + fi + # Don't bother testing any more if we have enough already. + # Currently we use at most 5 disks plus 1 for temporary disks. + [ ${#DISKS[@]} -eq 6 ] && break +done +export KEEP="$(zpool list -H -o name)" + +# Pull in constants. +. ${STF_SUITE}/include/constants.cfg |
