]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
Update ZTS to work on FreeBSD
[mirror_zfs.git] / tests / zfs-tests / tests / functional / delegate / delegate_common.kshlib
index d088eaf371a42aac05e93844f95dcf3648a28deb..6643f938d7a5890ef05bae597213e37402601a4c 100644 (file)
@@ -483,6 +483,7 @@ function verify_userprop
        typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
 
        user_run $user zfs set "$user:ts=$stamp" $dtst
+       zpool sync ${dtst%%/*}
        if [[ $stamp != $(get_prop "$user:ts" $dtst) ]]; then
                return 1
        fi
@@ -684,7 +685,7 @@ function verify_fs_destroy
 
 # Verify that given the correct delegation, a regular user can:
 #      Take a snapshot of an unmounted dataset
-#      Take a snapshot of an mounted dataset
+#      Take a snapshot of a mounted dataset
 #      Create a snapshot by making a directory in the .zfs/snapshot directory
 function verify_fs_snapshot
 {
@@ -716,12 +717,15 @@ function verify_fs_snapshot
        fi
        log_must zfs destroy $snap
 
-       typeset snapdir=${mntpt}/.zfs/snapshot/snap.$stamp
-       user_run $user mkdir $snapdir
-       if ! datasetexists $snap ; then
-               return 1
+       # Creating snaps via mkdir is not supported on FreeBSD
+       if ! is_freebsd; then
+               typeset snapdir=${mntpt}/.zfs/snapshot/snap.$stamp
+               user_run $user mkdir $snapdir
+               if ! datasetexists $snap ; then
+                       return 1
+               fi
+               log_must zfs destroy $snap
        fi
-       log_must zfs destroy $snap
 
        return 0
 }