# 2. Apply 'zfs set mountpoint=path <filesystem>'.
# 3. Change directory to that given mountpoint.
# 3. Invoke 'zfs mount <filesystem>'.
-# 4. Verify that mount succeeds on Linux and fails for other platforms.
+# 4. Verify that mount succeeds on Linux and FreeBSD and fails for other
+# platforms.
#
verify_runnable "both"
function cleanup
{
+ [[ "$PWD" = "$TESTDIR" ]] && cd -
log_must zfs set mountpoint=$TESTDIR $TESTPOOL/$TESTFS
log_must force_unmount $TESTPOOL/$TESTFS
return 0
zfs $mountcmd $TESTPOOL/$TESTFS
ret=$?
-if is_linux; then
+if is_linux || is_freebsd; then
(( ret == 0 )) || \
log_fail "'zfs $mountcmd $TESTPOOL/$TESTFS' " \
"unexpected return code of $ret."
fi
log_note "Make sure the filesystem $TESTPOOL/$TESTFS is unmounted"
-if is_linux; then
+if is_linux || is_freebsd; then
mounted $TESTPOOL/$TESTFS || \
log_fail Filesystem $TESTPOOL/$TESTFS is unmounted
else