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
@@ -75,6 +75,11 @@ firstvdev=${array[0]}
typeset -i i=1
while [[ $i -lt ${#CHECKSUM_TYPES[*]} ]]; do
type=${CHECKSUM_TYPES[i]}
# edonr not supported on FreeBSD
if is_freebsd && [[ "$type" == "edonr" ]] ; then
(( i = i + 1 ))
continue
fi
log_must zfs set checksum=$type $TESTPOOL
log_must file_write -o overwrite -f $TESTDIR/test_$type \
-b $WRITESZ -c 5 -d R
@@ -96,6 +101,11 @@ log_assert "Test corrupting the files and seeing checksum errors"
typeset -i j=1
while [[ $j -lt ${#CHECKSUM_TYPES[*]} ]]; do
type=${CHECKSUM_TYPES[$j]}
# edonr not supported on FreeBSD
if is_freebsd && [[ "$type" == "edonr" ]] ; then
(( j = j + 1 ))
continue
fi
log_must zfs set checksum=$type $TESTPOOL
log_must file_write -o overwrite -f $TESTDIR/test_$type \
-b $WRITESZ -c 5 -d R