ZTS: Another round of changes for FreeBSD

Highlights:
* is_linux -> is_illumos swaps
* make block_device_wait more clever when paths are given
* slightly optimize default_cleanup_noexit
* remove platform differences in user_run
* temporarily expect non-libfetch behavior for keylocation=/foo/bar
* fix sharenfs exceptions
* don't test multihost property
* fix misc broken platform checks
* clear zinjected faults in removal_resume_export callback

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10092
This commit is contained in:
Ryan Moeller
2020-03-06 12:31:32 -05:00
committed by GitHub
parent f5f6fb03b7
commit 2b95e91132
11 changed files with 82 additions and 59 deletions
+22 -3
View File
@@ -74,14 +74,33 @@ function block_device_wait
{
if is_linux; then
udevadm trigger $*
typeset local start=$SECONDS
typeset start=$SECONDS
udevadm settle
typeset local elapsed=$((SECONDS - start))
typeset elapsed=$((SECONDS - start))
[[ $elapsed > 60 ]] && \
log_note udevadm settle time too long: $elapsed
elif is_freebsd; then
sleep 3
if [[ ${#@} -eq 0 ]]; then
sleep 3
return
fi
fi
# Poll for the given paths to appear, but give up eventually.
typeset -i i
for (( i = 0; i < 5; ++i )); do
typeset missing=false
typeset dev
for dev in "${@}"; do
if ! [[ -f $dev ]]; then
missing=true
break
fi
done
if ! $missing; then
break
fi
sleep ${#@}
done
}
#
+2 -8
View File
@@ -612,8 +612,8 @@ function default_cleanup_noexit
then
destroy_pool $pool
fi
ALL_POOLS=$(get_all_pools)
done
ALL_POOLS=$(get_all_pools)
done
zfs mount -a
@@ -3315,13 +3315,7 @@ function user_run
shift
log_note "user:$user $@"
if is_freebsd; then
eval "su \$user -c \"$@\"" > $TEST_BASE_DIR/out 2>$TEST_BASE_DIR/err
return $?
else
eval su - \$user -c \"$@\" > $TEST_BASE_DIR/out 2>$TEST_BASE_DIR/err
return $?
fi
eval su - \$user -c \"$@\" > $TEST_BASE_DIR/out 2>$TEST_BASE_DIR/err
}
#