ZTS: Misc fixes for FreeBSD
* Check for mountd in is_shared to avoid timeout when not running * Enhance robustness of some cleanup functions * Simplify atime lookup * Skip sharenfs validation for now * Don't add mountpoint property to inheritance validation on FreeBSD Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10047
This commit is contained in:
parent
a33cb7e01a
commit
3a192f7d89
|
@ -1328,7 +1328,7 @@ function is_shared_freebsd
|
||||||
{
|
{
|
||||||
typeset fs=$1
|
typeset fs=$1
|
||||||
|
|
||||||
showmount -E | grep -qx $fs
|
pgrep -q mountd && showmount -E | grep -qx $fs
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_shared_illumos
|
function is_shared_illumos
|
||||||
|
|
|
@ -48,7 +48,7 @@ function check_atime_updated
|
||||||
typeset before=$(stat -c %X $filename)
|
typeset before=$(stat -c %X $filename)
|
||||||
sleep 2
|
sleep 2
|
||||||
elif is_freebsd; then
|
elif is_freebsd; then
|
||||||
typeset before=$(ls -luD "%Y-%m-%d %R.%s" $filename | awk '{print $7}')
|
typeset before=$(stat -f %a $filename)
|
||||||
sleep 2
|
sleep 2
|
||||||
else
|
else
|
||||||
typeset before=$(ls -Eu $filename | awk '{print $7}')
|
typeset before=$(ls -Eu $filename | awk '{print $7}')
|
||||||
|
@ -59,7 +59,7 @@ function check_atime_updated
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
typeset after=$(stat -c %X $filename)
|
typeset after=$(stat -c %X $filename)
|
||||||
elif is_freebsd; then
|
elif is_freebsd; then
|
||||||
typeset after=$(ls -luD "%Y-%m-%d %R.%s" $filename | awk '{print $7}')
|
typeset after=$(stat -f %a $filename)
|
||||||
else
|
else
|
||||||
typeset after=$(ls -Eu $filename | awk '{print $7}')
|
typeset after=$(ls -Eu $filename | awk '{print $7}')
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -97,8 +97,16 @@ log_assert "'zfs create' should return an error with badly-formed parameters."
|
||||||
|
|
||||||
typeset -i i=0
|
typeset -i i=0
|
||||||
while [[ $i -lt ${#args[*]} ]]; do
|
while [[ $i -lt ${#args[*]} ]]; do
|
||||||
log_mustnot zfs create ${args[i]} $TESTPOOL/$TESTFS1
|
typeset arg=${args[i]}
|
||||||
log_mustnot zfs create -p ${args[i]} $TESTPOOL/$TESTFS1
|
if is_freebsd; then
|
||||||
|
# FreeBSD does not strictly validate share options (yet).
|
||||||
|
if [[ "$arg" == "-o sharenfs="* ]]; then
|
||||||
|
((i = i + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
log_mustnot zfs create $arg $TESTPOOL/$TESTFS1
|
||||||
|
log_mustnot zfs create -p $arg $TESTPOOL/$TESTFS1
|
||||||
((i = i + 1))
|
((i = i + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,15 @@ log_assert "'zpool create -O' should return an error with badly formed parameter
|
||||||
|
|
||||||
typeset -i i=0
|
typeset -i i=0
|
||||||
while (( $i < ${#args[*]} )); do
|
while (( $i < ${#args[*]} )); do
|
||||||
log_mustnot zpool create -O ${args[i]} -f $TESTPOOL $DISKS
|
typeset arg=${args[i]}
|
||||||
|
if is_freebsd; then
|
||||||
|
# FreeBSD does not strictly validate share opts (yet).
|
||||||
|
if [[ $arg == "-o sharenfs="* ]]; then
|
||||||
|
((i = i + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
log_mustnot zpool create -O $arg -f $TESTPOOL $DISKS
|
||||||
((i = i + 1))
|
((i = i + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,8 @@ function uncompress_pool
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
poolexists $POOL_NAME && log_must zpool destroy $POOL_NAME
|
poolexists $POOL_NAME && destroy_pool $POOL_NAME
|
||||||
[[ -e /$TESTPOOL/$POOL_FILE ]] && rm /$TESTPOOL/$POOL_FILE
|
rm -f /$TESTPOOL/$POOL_FILE
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log_assert "'zpool import' fails for pool that was not cleanly exported"
|
log_assert "'zpool import' fails for pool that was not cleanly exported"
|
||||||
|
|
|
@ -56,11 +56,7 @@ function check_zdb
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
if [ -e $TEST_BASE_DIR/zdb_001_neg.$$.txt ]
|
rm -f $TEST_BASE_DIR/zdb_001_neg.$$.txt $TEST_BASE_DIR/zdb.$$
|
||||||
then
|
|
||||||
rm $TEST_BASE_DIR/zdb_001_neg.$$.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_runnable "global"
|
verify_runnable "global"
|
||||||
|
|
|
@ -44,10 +44,7 @@
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
if [ -e "$TEMPFILE" ]
|
rm -f "$TEMPFILE"
|
||||||
then
|
|
||||||
rm -f "$TEMPFILE"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log_onexit cleanup
|
log_onexit cleanup
|
||||||
|
@ -55,7 +52,7 @@ log_assert "zfs shows a usage message when run as a user"
|
||||||
|
|
||||||
TEMPFILE="$TEST_BASE_DIR/zfs_001_neg.$$.txt"
|
TEMPFILE="$TEST_BASE_DIR/zfs_001_neg.$$.txt"
|
||||||
|
|
||||||
eval "zfs > $TEMPFILE 2>&1"
|
zfs > $TEMPFILE 2>&1
|
||||||
log_must grep "usage: zfs command args" "$TEMPFILE"
|
log_must grep "usage: zfs command args" "$TEMPFILE"
|
||||||
|
|
||||||
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
|
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
|
||||||
|
|
|
@ -406,14 +406,15 @@ if is_linux; then
|
||||||
def_val+=("off")
|
def_val+=("off")
|
||||||
local_val+=("off")
|
local_val+=("off")
|
||||||
else
|
else
|
||||||
prop+=("aclmode" "" \
|
prop+=("aclmode" "")
|
||||||
"mountpoint" "")
|
def_val+=("discard")
|
||||||
def_val+=("discard" \
|
local_val+=("groupmask")
|
||||||
"")
|
fi
|
||||||
local_val+=("groupmask" \
|
if is_illumos; then
|
||||||
"$TESTDIR")
|
prop+=("mountpoint" "")
|
||||||
|
def_val+=("")
|
||||||
|
local_val+=("$TESTDIR")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Global flag indicating whether the default record size had been
|
# Global flag indicating whether the default record size had been
|
||||||
|
|
Loading…
Reference in New Issue