Update ZTS to work on FreeBSD

Update the common ZTS scripts and individual test cases as needed 
in order to allow them to be run on FreeBSD.  The high level goal
is to provide compatibility wrappers whenever possible to minimize
changes to individual test cases.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9692
This commit is contained in:
Matthew Macy
2019-12-18 12:29:43 -08:00
committed by Brian Behlendorf
parent 118fc3ef07
commit 7839c4b5e1
145 changed files with 1723 additions and 573 deletions
@@ -23,15 +23,20 @@
verify_runnable "global"
DISK1=${DISKS%% *}
if is_freebsd; then
diskinfo -v $DISKS | grep -qE 'No.*# TRIM/UNMAP support' &&
log_unsupported "DISKS do not support discard (TRIM/UNMAP)"
else
DISK1=${DISKS%% *}
typeset -i max_discard=0
if [[ -b $DEV_RDSKDIR/$DISK1 ]]; then
max_discard=$(lsblk -Dbn $DEV_RDSKDIR/$DISK1 | awk '{ print $4; exit }')
fi
typeset -i max_discard=0
if [[ -b $DEV_RDSKDIR/$DISK1 ]]; then
max_discard=$(lsblk -Dbn $DEV_RDSKDIR/$DISK1 | awk '{ print $4; exit }')
fi
if test $max_discard -eq 0; then
log_unsupported "DISKS do not support discard (TRIM/UNMAP)"
if test $max_discard -eq 0; then
log_unsupported "DISKS do not support discard (TRIM/UNMAP)"
fi
fi
log_pass