]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_005_pos.ksh
Update ZTS to work on FreeBSD
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zfs_mount / zfs_mount_005_pos.ksh
index fc97520f57db5445485ee179d2ccb9ae5b95d67b..c0cb693f6ce6708eb3402d9fe2132d1743b6ccb4 100755 (executable)
 # 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
@@ -74,7 +76,7 @@ cd $TESTDIR || \
 
 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."
@@ -85,7 +87,7 @@ else
 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