]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_001_pos.ksh
OpenZFS 7290 - ZFS test suite needs to control what utilities it can run
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zfs_share / zfs_share_001_pos.ksh
index 084b18d1f17281907a251087606b14455ab8fe80..7638660e3d8f7314265c8518f21796b9d1b98635 100755 (executable)
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
 . $STF_SUITE/include/libtest.shlib
 
 #
@@ -51,21 +55,21 @@ function cleanup
 {
        typeset -i i=0
        while (( i < ${#fs[*]} )); do
-               log_must $ZFS set sharenfs=off ${fs[((i+1))]}
+               log_must zfs set sharenfs=off ${fs[((i+1))]}
                unshare_fs ${fs[i]}
 
                ((i = i + 2))
        done
 
        if mounted $TESTPOOL/$TESTFS-clone; then
-               log_must $ZFS unmount $TESTDIR2
+               log_must zfs unmount $TESTDIR2
        fi
 
        datasetexists $TESTPOOL/$TESTFS-clone && \
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS-clone
+               log_must zfs destroy -f $TESTPOOL/$TESTFS-clone
 
        if snapexists "$TESTPOOL/$TESTFS@snapshot"; then
-               log_must $ZFS destroy -f $TESTPOOL/$TESTFS@snapshot
+               log_must zfs destroy -f $TESTPOOL/$TESTFS@snapshot
        fi
 }
 
@@ -84,31 +88,31 @@ function test_share # mntp filesystem
        not_shared $mntp || \
            log_fail "File system $filesystem is already shared."
 
-       log_must $ZFS set sharenfs=on $filesystem
+       log_must zfs set sharenfs=on $filesystem
        is_shared $mntp || \
            log_fail "File system $filesystem is not shared (set sharenfs)."
 
        #
        # Verify 'zfs share' works as well.
        #
-       log_must $ZFS unshare $filesystem
+       log_must zfs unshare $filesystem
        is_shared $mntp && \
            log_fail "File system $filesystem is still shared."
 
-       log_must $ZFS share $filesystem
+       log_must zfs share $filesystem
        is_shared $mntp || \
            log_fail "file system $filesystem is not shared (zfs share)."
 
        log_note "Sharing a shared file system fails."
-       log_mustnot $ZFS share $filesystem
+       log_mustnot zfs share $filesystem
 }
 
 log_assert "Verify that 'zfs share' succeeds as root."
 log_onexit cleanup
 
-log_must $ZFS snapshot $TESTPOOL/$TESTFS@snapshot
-log_must $ZFS clone $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTFS-clone
-log_must $ZFS set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS-clone
+log_must zfs snapshot $TESTPOOL/$TESTFS@snapshot
+log_must zfs clone $TESTPOOL/$TESTFS@snapshot $TESTPOOL/$TESTFS-clone
+log_must zfs set mountpoint=$TESTDIR2 $TESTPOOL/$TESTFS-clone
 
 typeset -i i=0
 while (( i < ${#fs[*]} )); do
@@ -132,7 +136,7 @@ done
 #
 # Try a zfs share -a and verify all file systems are shared.
 #
-log_must $ZFS share -a
+log_must zfs share -a
 
 i=0
 while (( i < ${#fs[*]} )); do
@@ -142,4 +146,4 @@ while (( i < ${#fs[*]} )); do
        ((i = i + 2))
 done
 
-log_pass "'$ZFS share [ -a ] <filesystem>' succeeds as root."
+log_pass "'zfs share [ -a ] <filesystem>' succeeds as root."