Index: projects/zfsd/head/etc/mtree/BSD.tests.dist =================================================================== --- projects/zfsd/head/etc/mtree/BSD.tests.dist (revision 329046) +++ projects/zfsd/head/etc/mtree/BSD.tests.dist (revision 329047) @@ -1,1044 +1,1040 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . bin cat .. chflags .. chmod .. date .. dd .. echo .. expr .. ln .. ls .. mkdir .. mv .. pax .. pkill .. pwait .. rmdir .. sh builtins .. errors .. execution .. expansion .. invocation .. parameters .. parser .. set-e .. .. sleep .. test .. .. cddl lib .. usr.bin ctfconvert .. .. usr.sbin dtrace common aggs .. arithmetic .. arrays .. assocs .. begin .. bitfields .. buffering .. builtinvar .. cg .. clauses .. cpc .. decls .. drops .. dtraceUtil .. end .. env .. enum .. error .. exit .. fbtprovider .. funcs .. grammar .. include .. inline .. io .. ip .. java_api .. json .. lexer .. llquantize .. mdb .. mib .. misc .. multiaggs .. offsetof .. operators .. pid .. plockstat .. pointers .. pragma .. predicates .. preprocessor .. print .. printa .. printf .. privs .. probes .. proc .. profile-n .. providers .. raise .. rates .. safety .. scalars .. sched .. scripting .. sdt .. sizeof .. speculation .. stability .. stack .. stackdepth .. stop .. strlen .. strtoll .. struct .. sugar .. syscall .. sysevent .. tick-n .. trace .. tracemem .. translators .. typedef .. types .. uctf .. union .. usdt .. ustack .. vars .. version .. .. .. zfsd .. .. .. etc rc.d .. .. games .. gnu lib .. usr.bin diff .. .. .. lib atf libatf-c detail .. .. libatf-c++ detail .. .. test-programs .. .. libarchive .. libc c063 .. db .. gen execve .. posix_spawn .. .. hash data .. .. iconv .. inet .. locale .. net getaddrinfo data .. .. .. nss .. regex data .. .. resolv .. rpc .. ssp .. setjmp .. stdio .. stdlib .. string .. sys .. time .. tls dso .. .. termios .. ttyio .. .. libcam .. libcasper services cap_dns .. cap_grp .. cap_pwd .. cap_sysctl .. .. .. libcrypt .. libdevdctl .. libkvm .. libmp .. libnv .. libproc .. libregex data .. .. librt .. libsbuf .. libthr dlopen .. .. libutil .. libxo .. msun .. .. libexec atf atf-check .. atf-sh .. .. rtld-elf .. .. sbin dhclient .. devd .. growfs .. ifconfig .. mdconfig .. pfctl files .. .. .. secure lib .. libexec .. usr.bin .. usr.sbin .. .. share examples tests atf .. plain .. tap .. .. .. zoneinfo .. .. sys acl .. aio .. cddl zfs bin .. include .. tests acl cifs .. nontrivial .. trivial .. .. atime .. bootfs .. cache .. cachefile .. clean_mirror .. cli_root zfs_upgrade .. zfs_promote .. zfs_clone .. zfs_property .. zfs_destroy .. zpool_create .. zpool_history .. zpool_expand .. zpool_remove .. zfs_mount .. zfs_unshare .. zdb .. zpool_online .. zpool_get .. zpool_export .. zfs_copies .. zfs_get .. zfs .. zpool_clear .. zpool_import blockfiles .. .. zpool .. zpool_offline .. zpool_replace .. zfs_rollback .. zpool_set .. zfs_send .. zfs_set .. zpool_detach .. zfs_diff .. zpool_scrub .. zfs_inherit .. zfs_snapshot .. zfs_share .. zpool_destroy .. zpool_status .. zfs_unmount .. zfs_receive .. zfs_create .. zpool_upgrade blockfiles .. .. zpool_add .. zfs_rename .. zpool_attach .. zfs_reservation .. .. cli_user misc .. zfs_list .. zpool_iostat .. zpool_list .. .. compression .. ctime .. delegate - zfs_allow - .. - zfs_unallow - .. .. devices .. exec .. grow_pool .. grow_replicas .. history .. hotplug .. hotspare .. inheritance .. interop .. inuse .. iscsi .. large_files .. largest_pool .. link_count .. mdb .. migration .. mmap .. mount .. mv_files .. nestedfs .. no_space .. online_offline .. pool_names .. poolversion .. privilege .. quota .. redundancy .. refquota .. refreserv .. remote cross_endian .. rebooting .. sharing .. .. rename_dirs .. replacement .. reservation .. rootpool .. rsend .. scrub_mirror .. slog .. snapshot .. snapused .. sparse .. threadsappend .. truncate .. txg_integrity .. userquota .. utils_test .. write_dirs .. xattr .. zfsd .. zil .. zinject .. zones .. zvol zvol_ENOSPC .. zvol_cli .. zvol_misc .. zvol_swap .. .. zvol_thrash .. .. .. .. dtrace .. fifo .. file .. fs tmpfs .. .. geom class concat .. eli .. gate .. gpt .. mirror .. nop .. part .. raid3 .. shsec .. stripe .. uzip etalon .. .. .. .. kern acct .. execve .. pipe .. .. kqueue libkqueue .. .. mac bsdextended .. portacl .. .. mqueue .. net .. netinet .. netipsec tunnel .. .. netpfil pf .. .. opencrypto .. pjdfstest chflags .. chmod .. chown .. ftruncate .. granular .. link .. mkdir .. mkfifo .. mknod .. open .. rename .. rmdir .. symlink .. truncate .. unlink .. utimensat .. .. posixshm .. sys .. vfs .. vm .. .. usr.bin apply .. awk .. basename .. bmake archives fmt_44bsd .. fmt_44bsd_mod .. fmt_oldbsd .. .. basic t0 .. t1 .. t2 .. t3 .. .. execution ellipsis .. empty .. joberr .. plus .. .. shell builtin .. meta .. path .. path_select .. replace .. select .. .. suffixes basic .. src_wild1 .. src_wild2 .. .. syntax directive-t0 .. enl .. funny-targets .. semi .. .. sysmk t0 2 1 .. .. mk .. .. t1 2 1 .. .. mk .. .. t2 2 1 .. .. mk .. .. .. variables modifier_M .. modifier_t .. opt_V .. t0 .. .. .. bsdcat .. calendar .. cmp .. compress .. cpio .. col .. comm .. csplit .. cut .. dc .. diff .. dirname .. du .. file2c .. find .. fold .. getconf .. grep .. gzip .. head .. hexdump .. ident .. indent .. join .. jot .. lastcomm .. limits .. m4 .. mkimg .. ncal .. opensm .. pr .. printf .. procstat .. rs .. sdiff .. sed regress.multitest.out .. .. soelim .. stat .. tail .. tar .. timeout .. tr .. truncate .. units .. uudecode .. uuencode .. uniq .. vmstat .. xargs .. xinstall .. xo .. yacc yacc .. .. .. usr.sbin chown .. etcupdate .. extattr .. fstyp .. makefs .. newsyslog .. nmtree .. pw .. rpcbind .. sa .. .. .. # vim: set expandtab ts=4 sw=4: Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/cleanup.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/cleanup.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/cleanup.ksh (nonexistent) @@ -1,32 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)cleanup.ksh 1.2 08/11/03 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -log_pass Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_010_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_010_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_010_pos.ksh (nonexistent) @@ -1,126 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_010_pos.ksh 1.3 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_010_pos -# -# DESCRIPTION: -# Scan the following permissions one by one to verify privileged user -# has correct permission delegation in datasets. -# -# STRATEGY: -# 1. Delegate all the permission one by one to user on dataset. -# 2. Verify privileged user has correct permission without any other -# permissions allowed. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-11-02) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify privileged user has correct permissions once which was "\ - "delegated to him in datasets" -log_onexit restore_root_datasets - -# -# Results in Results in -# Permission Filesystem Volume -# -set -A perms create true false \ - snapshot true true \ - mount true false \ - send true true \ - allow true true \ - quota true false \ - reservation true true \ - recordsize true false \ - mountpoint true false \ - checksum true true \ - compression true true \ - canmount true false \ - atime true false \ - devices true false \ - exec true false \ - volsize false true \ - setuid true false \ - readonly true true \ - snapdir true false \ - userprop true true \ - aclmode true false \ - aclinherit true false \ - rollback true true \ - clone true true \ - rename true true \ - promote true true \ - zoned true false \ - shareiscsi true true \ - xattr true false \ - receive true false \ - destroy true true -if is_global_zone; then - typeset -i n=${#perms[@]} - perms[((n))]="sharenfs"; perms[((n+1))]="true"; perms[((n+2))]="false" - perms[((n+3))]="share"; perms[((n+4))]="true"; perms[((n+5))]="false" -fi - -for dtst in $DATASETS; do - typeset -i k=1 - typeset type=$(get_prop type $dtst) - [[ $type == "volume" ]] && k=2 - - typeset -i i=0 - while (( i < ${#perms[@]} )); do - log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst - - if [[ ${perms[((i+k))]} == "true" ]]; then - log_must verify_perm $dtst ${perms[$i]} $STAFF1 - else - log_must verify_noperm $dtst ${perms[$i]} $STAFF1 - fi - - log_must restore_root_datasets - - ((i += 3)) - done -done - -log_pass "Verify privileged user has correct permissions " \ - "in datasets passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_001_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_001_pos.ksh (nonexistent) @@ -1,117 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_001_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_001_pos -# -# DESCRIPTION: -# "everyone" is interpreted as the keyword "everyone" whatever the same -# name user or group is existing. -# -# STRATEGY: -# 1. Create user 'everyone'. -# 2. Verify 'everyone' is interpreted as keywords. -# 3. Create group 'everyone'. -# 4. Verify 'everyone' is interpreted as keywords. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-14) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -function cleanup -{ - if [[ $user_added == "TRUE" ]] ; then - del_user everyone - fi - if [[ $group_added == "TRUE" ]] ; then - del_group everyone - fi - - restore_root_datasets -} - -log_assert "everyone' is interpreted as a keyword even if a user " \ - "or group named 'everyone' exists." -log_onexit cleanup - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms="snapshot,reservation,compression,send,allow,\ -userprop" -else - typeset perms="snapshot,reservation,compression,checksum,\ -send,allow,userprop" -fi - -log_note "Create a user called 'everyone'." -if ! $ID everyone > /dev/null 2>&1; then - user_added="TRUE" - log_must $USERADD everyone -fi -for dtst in $DATASETS ; do - log_must $ZFS allow everyone $perms $dtst - log_must verify_perm $dtst $perms $EVERYONE "everyone" -done -log_must restore_root_datasets -if [[ $user_added == "TRUE" ]]; then - log_must $USERDEL everyone -fi - -log_note "Created a group called 'everyone'." -if ! $CAT /etc/group | $AWK -F: '{print $1}' | \ - $GREP -w 'everyone' > /dev/null 2>&1 -then - group_added="TRUE" - log_must $GROUPADD everyone -fi - -for dtst in $DATASETS ; do - log_must $ZFS allow everyone $perms $dtst - log_must verify_perm $dtst $perms $EVERYONE -done -log_must restore_root_datasets -if [[ $group_added == "TRUE" ]]; then - log_must $GROUPDEL everyone -fi - -log_pass "everyone is always interpreted as keyword passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_002_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_002_pos.ksh (nonexistent) @@ -1,98 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_002_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_002_pos -# -# DESCRIPTION: -# argument is interpreted as a user if possible, then as a group as -# possible. -# -# STRATEGY: -# 1. Create user $STAFF_GROUP -# 2. Delegate permissions to $STAFF_GROUP -# 3. Verify user $STAFF_GROUP has the permissions. -# 4. Delete user $STAFF_GROUP and allow the permission to $STAFF_GROUP -# 5. Verify $STAFF_GROUP is interpreted as group. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-14) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -function cleanup -{ - if $ID $STAFF_GROUP > /dev/null 2>&1; then - log_must del_user $STAFF_GROUP - fi - - restore_root_datasets -} - -log_assert " is interpreted as user if possible, then as group." -log_onexit cleanup - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms="snapshot,reservation,compression,send,allow,\ -userprop" -else - typeset perms="snapshot,reservation,compression,checksum,\ -send,allow,userprop" -fi - -log_must $USERADD $STAFF_GROUP -for dtst in $DATASETS ; do - log_must $ZFS allow $STAFF_GROUP $perms $dtst - log_must verify_perm $dtst $perms $STAFF_GROUP - log_must verify_noperm $dtst $perms $STAFF1 $STAFF2 -done - -log_must restore_root_datasets - -log_must del_user $STAFF_GROUP -for dtst in $datasets ; do - log_must $ZFS allow $STAFF_GROUP $perms $dtst - log_must verify_perm $dtst $perms $STAFF1 $STAFF2 -done - -log_pass " is interpreted as user if possible, then as group passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_003_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_003_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_003_pos.ksh (nonexistent) @@ -1,116 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_003_pos.ksh 1.4 09/08/06 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_003_pos -# -# DESCRIPTION: -# Verify option '-l' only allow permission to the dataset itself. -# -# STRATEGY: -# 1. Create descendent datasets of $ROOT_TESTFS -# 2. Select user, group and everyone and set local permission separately. -# 3. Set locally permissions to $ROOT_TESTFS or $ROOT_TESTVOL. -# 4. Verify the permissions are only allow on $ROOT_TESTFS or -# $ROOT_TESTVOL. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-19) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify option '-l' only allow permission to the dataset itself." -log_onexit restore_root_datasets - -childfs=$ROOT_TESTFS/childfs - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms="snapshot,reservation,compression,allow,\ -userprop" -else - typeset perms="snapshot,reservation,compression,checksum,\ -allow,userprop" -fi - -if check_version "5.10" ; then - perms="${perms},send" -fi - -log_must $ZFS create $childfs - -for dtst in $DATASETS ; do - log_must $ZFS allow -l $STAFF1 $perms $dtst - log_must verify_perm $dtst $perms $STAFF1 - if [[ $dtst == $ROOT_TESTFS ]] ; then - log_must verify_noperm $childfs $perms \ - $STAFF1 $STAFF2 $OTHER1 $OTHER2 - fi -done - -log_must restore_root_datasets - -log_must $ZFS create $childfs -for dtst in $DATASETS ; do - log_must $ZFS allow -l -g $STAFF_GROUP $perms $dtst - log_must verify_perm $dtst $perms $STAFF1 $STAFF2 - if [[ $dtst == $ROOT_TESTFS ]] ; then - log_must verify_noperm $childfs $perms \ - $STAFF1 $STAFF2 $OTHER1 $OTHER2 - fi -done - -log_must restore_root_datasets - -log_must $ZFS create $childfs -for dtst in $DATASETS ; do - log_must $ZFS allow -l -e $perms $dtst - log_must verify_perm $dtst $perms $STAFF1 $STAFF2 $OTHER1 $OTHER2 - if [[ $dtst == $ROOT_TESTFS ]] ; then - log_must verify_noperm $childfs $perms \ - $STAFF1 $STAFF2 $OTHER1 $OTHER2 - fi -done - -log_must restore_root_datasets - -log_pass "Verify option '-l' only allow permission to the dataset itself pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_004_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_004_pos.ksh (nonexistent) @@ -1,119 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_004_pos.ksh 1.4 09/08/06 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_004_pos -# -# DESCRIPTION: -# Verify option '-d' allow permission to the descendent datasets, and not -# for this dataset itself. -# -# STRATEGY: -# 1. Create descendent datasets of $ROOT_TESTFS -# 2. Select user, group and everyone and set descendent permission -# separately. -# 3. Set descendent permissions to $ROOT_TESTFS or $ROOT_TESTVOL. -# 4. Verify those permissions are allowed to $ROOT_TESTFS's -# descendent dataset. -# 5. Verify the permissions are not allowed to $ROOT_TESTFS or -# $ROOT_TESTVOL. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-18) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify option '-d' allow permission to the descendent datasets." -log_onexit restore_root_datasets - -childfs=$ROOT_TESTFS/childfs - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms="snapshot,reservation,compression,allow,\ -userprop" -else - typeset perms="snapshot,reservation,compression,checksum,\ -allow,userprop" -fi - -if check_version "5.10" ; then - perms="${perms},send" -fi - -# Verify option '-d' only affect sub-datasets -log_must $ZFS create $childfs -for dtst in $DATASETS ; do - log_must $ZFS allow -d $STAFF1 $perms $dtst - log_must verify_noperm $dtst $perms $STAFF1 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_perm $childfs $perms $STAFF1 - fi -done - -log_must restore_root_datasets - -# Verify option '-d + -g' affect group in sub-datasets. -log_must $ZFS create $childfs -for dtst in $DATASETS ; do - log_must $ZFS allow -d -g $STAFF_GROUP $perms $dtst - log_must verify_noperm $dtst $perms $STAFF2 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_perm $childfs $perms $STAFF2 - fi -done - -log_must restore_root_datasets - -# Verify option '-d + -e' affect everyone in sub-datasets. -log_must $ZFS create $childfs -for dtst in $DATASETS ; do - log_must $ZFS allow -d -e $perms $dtst - log_must verify_noperm $dtst $perms $OTHER1 $OTHER2 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_perm $childfs $perms $OTHER1 $OTHER2 - fi -done - -log_must restore_root_datasets - -log_pass "Verify option '-d' allow permission to the descendent datasets pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_011_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_011_neg.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_011_neg.ksh (nonexistent) @@ -1,80 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_011_neg.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_011_neg -# -# DESCRIPTION: -# Verify zpool subcmds and system readonly properties can't be delegated. -# -# STRATEGY: -# 1. Loop all the zpool subcmds and readonly properties, except permission -# 'create' & 'destroy'. -# 2. Verify those subcmd or properties can't be delegated. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-12-13) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify zpool subcmds and system readonly properties can't be " \ - "delegated." -log_onexit restore_root_datasets - -set -A invalid_perms \ - add remove list iostat \ - status offline online clear \ - attach detach replace scrub \ - export import upgrade \ - type creation used available \ - referenced compressratio mounted - -for dtst in $DATASETS ; do - typeset -i i=0 - - while ((i < ${#invalid_perms[@]})); do - log_mustnot $ZFS allow $STAFF1 ${invalid_perms[$i]} $dtst - - ((i += 1)) - done -done - -log_pass "Verify zpool subcmds and system readonly properties passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_005_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_005_pos.ksh (nonexistent) @@ -1,101 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_005_pos.ksh 1.4 09/08/06 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_005_pos -# -# DESCRIPTION: -# Verify option '-c' will be granted locally to the creator on any -# newly-created descendent file systems. -# -# STRATEGY: -# 1. Allow create permissions to everyone on $ROOT_TESTFS locally. -# 2. Allow '-c' create to $ROOT_TESTFS. -# 3. chmod 777 the mountpoint of $ROOT_TESTFS -# 4. Verify only creator can create descendent dataset on -# $ROOT_TESTFS/$user. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-19) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify option '-c' will be granted locally to the creator." -log_onexit restore_root_datasets - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms="snapshot,reservation,compression,allow,\ -userprop" -else - typeset perms="snapshot,reservation,compression,checksum,\ -allow,userprop" -fi - -if check_version "5.10" ; then - perms="${perms},send" -fi - -log_must $ZFS allow -l everyone create,mount $ROOT_TESTFS -log_must $ZFS allow -c $perms $ROOT_TESTFS - -mntpnt=$(get_prop mountpoint $ROOT_TESTFS) -log_must $CHMOD 777 $mntpnt - -for user in $EVERYONE; do - childfs=$ROOT_TESTFS/$user - - user_run $user $ZFS create $childfs - - for other in $EVERYONE; do - # - # Verify only the creator has the $perm time permissions. - # - if [[ $other == $user ]]; then - log_must verify_perm $childfs $perms $user - else - log_must verify_noperm $childfs $perms $other - fi - done -done - -log_pass "Verify option '-c' will be granted locally to the creator passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_012_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_012_neg.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_012_neg.ksh (nonexistent) @@ -1,91 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_012_neg.ksh 1.1 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_012_neg -# -# DESCRIPTION: -# Scan all permissions one by one to verify privileged user -# can not use permissions properly when delegation property is set off -# -# STRATEGY: -# 1. Delegate all the permission one by one to user on dataset. -# 2. Verify privileged user can not use permissions properly when -# delegation property is off -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2007-06-19) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "global" - -function cleanup -{ - log_must $ZPOOL set delegation=on $TESTPOOL - log_must restore_root_datasets -} - -log_assert "Verify privileged user can not use permissions properly when " \ - "delegation property is set off" -log_onexit cleanup - - -set -A perms create snapshot mount send allow quota reservation \ - recordsize mountpoint checksum compression canmount atime \ - devices exec volsize setuid readonly snapdir userprop \ - aclmode aclinherit rollback clone rename promote \ - zoned shareiscsi xattr receive destroy sharenfs share - -log_must $ZPOOL set delegation=off $TESTPOOL - -for dtst in $DATASETS; do - typeset -i i=0 - while (( i < ${#perms[@]} )); do - - log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst - log_must verify_noperm $dtst ${perms[$i]} $STAFF1 - - log_must restore_root_datasets - ((i += 1)) - done -done - -log_pass "Verify privileged user can not use permissions properly when " \ - "delegation property is set off" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_006_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_006_pos.ksh (nonexistent) @@ -1,89 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_006_pos.ksh 1.2 08/11/03 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_006_pos -# -# DESCRIPTION: -# Changing permissions in a set will change what is allowed wherever the -# set is used. -# -# STRATEGY: -# 1. Set create as set @basic. -# 2. Allow set @basic to $STAFF1 on $ROOT_TESTFS or $ROOT_TESTVOL -# 3. Verify $STAFF1 has create permissions. -# 4. Reset snapshot,allow to $basic -# 5. Verify now $STAFF1 have create,allow,destroy permissions. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-19) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Changing permissions in a set will change what is allowed " \ - "wherever the set is used." -log_onexit restore_root_datasets - -fs1=$ROOT_TESTFS/fs1; fs2=$ROOT_TESTFS/fs2 -log_must $ZFS create $fs1 -log_must $ZFS create $fs2 - -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - perms1="snapshot,checksum,reservation" -else - perms1="snapshot,reservation" -fi - -for dtst in $DATASETS $fs1 $fs2; do - log_must $ZFS allow -s @basic $perms1 $dtst - log_must $ZFS allow $STAFF1 @basic $dtst - log_must verify_perm $dtst $perms1 $STAFF1 -done - -perms2="allow,send,compression,userprop" -for dtst in $DATASETS $fs1 $fs2; do - log_must $ZFS allow -s @basic $perms2 $dtst - log_must verify_perm $dtst ${perms1},${perms2} $STAFF1 -done - -log_pass "Changing permissions in a set will change what is allowed passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_007_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_007_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_007_pos.ksh (nonexistent) @@ -1,120 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_007_pos.ksh 1.3 08/11/03 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_007_pos -# -# DESCRIPTION: -# Verify the permissions set will be masked on its descendent -# datasets by same name set. -# -# STRATEGY: -# 1. Create $ROOT_TESTFS/childfs -# 2. Set permission $perms1 to @set on $ROOT_TESTFS -# 3. Reset permission $perms2 to @set on $ROOT_TESTFS/childfs -# 4. Allow @set to $STAFF1 on $ROOT_TESTFS/childfs -# 5. Verify $perms2 is delegated on $ROOT_TESTFS/childfs and its -# descendent. -# 6. Allow @set to $STAFF1 on $ROOT_TESTFS -# 7. Verify $perms1 is not appended to $STAFF1 on $ROOT_TESTFS/childfs and -# its descendent since it is masked -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-19) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify permission set can be masked on descendent dataset." -log_onexit restore_root_datasets - -typeset perms1="snapshot,reservation,compression" -eval set -A dataset $DATASETS -enc=$(get_prop encryption $dataset) -if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then - typeset perms2="send,allow,userprop" -else - typeset perms2="checksum,send,allow,userprop" -fi - -# -# Define three level filesystems -# -childfs=$ROOT_TESTFS/childfs -grandchild=$childfs/grandchild -log_must $ZFS create $childfs -log_must $ZFS create $grandchild - -# -# Setting different permissions to the same set on two level. -# But only assign the user at one level. -# -log_must $ZFS allow -s @set $perms1 $ROOT_TESTFS -log_must $ZFS allow -s @set $perms2 $childfs -log_must $ZFS allow $STAFF1 @set $childfs - -# -# Verify only perms2 is valid to user on the level which he was assigned. -# -log_must verify_noperm $ROOT_TESTFS $perms1 $STAFF1 -for fs in $childfs $grandchild ; do - log_must verify_noperm $childfs $perms1 $STAFF1 - log_must verify_perm $childfs $perms2 $STAFF1 -done - -# -# Delegate @set to STAFF1 on ROOT_TESTFS, verify $perms1 will not be appended -# to its descendent datasets since it is masked -# -log_must $ZFS allow $STAFF1 @set $ROOT_TESTFS -log_must verify_perm $ROOT_TESTFS $perms1 $STAFF1 -for fs in $childfs $grandchild ; do - log_must verify_noperm $childfs $perms1 $STAFF1 - log_must verify_perm $childfs $perms2 $STAFF1 -done - -# Remove the mask, $perms1 will be allowed to its descendent datasets -log_must $ZFS unallow -s @set $childfs -for fs in $childfs $grandchild ; do - log_must verify_noperm $childfs $perms2 $STAFF1 - log_must verify_perm $childfs $perms1 $STAFF1 -done - -log_pass "Verify permission set can be masked on descendetn dataset pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_008_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_008_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_008_pos.ksh (nonexistent) @@ -1,90 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_008_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_008_pos -# -# DESCRIPTION: -# non-root user can allow any permissions which he is holding to -# other else user when it get 'allow' permission. -# -# STRATEGY: -# 1. Set two set permissions to two datasets locally. -# 2. Verify the non-root user can allow permission if he has allow -# permission. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-20) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify non-root user can allow permissions." -log_onexit restore_root_datasets - -perms1="snapshot,reservation" -perms2="send,compression,checksum,userprop" -childfs=$ROOT_TESTFS/childfs - -log_must $ZFS create $childfs - -for dtst in $DATASETS ; do - # Delegate local permission to $STAFF1 - log_must $ZFS allow -l $STAFF1 $perms1 $dtst - log_must $ZFS allow -l $STAFF1 allow $dtst - - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must $ZFS allow -l $STAFF1 $perms2 $childfs - # $perms1 is local permission in $ROOT_TESTFS - log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms1 $childfs - log_must verify_noperm $childfs $perms1 $OTHER1 - fi - - # Verify 'allow' give non-privilege user delegated permission. - log_must user_run $STAFF1 $ZFS allow -l $OTHER1 $perms1 $dtst - log_must verify_perm $dtst $perms1 $OTHER1 - - # $perms2 was not allow to $STAFF1, so he have no permission to - # delegate permission to other else. - log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms2 $dtst - log_must verify_noperm $dtst $perms2 $OTHER1 -done - -log_pass "Verify non-root user can allow permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_009_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_009_neg.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_009_neg.ksh (nonexistent) @@ -1,76 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_allow_009_neg.ksh 1.1 07/01/09 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_allow_009_neg -# -# DESCRIPTION: -# zfs allow can deal with invalid arguments.(Invalid options or combination) -# -# STRATEGY: -# 1. Verify invalid argumets will cause error. -# 2. Verify non-optional argument was missing will cause error. -# 3. Verify invalid options cause error. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-20) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify invalid arguments are handled correctly." -log_onexit restore_root_datasets - -# Permission sets are limited to 64 characters in length. -longset="set123456789012345678901234567890123456789012345678901234567890123" -for dtst in $DATASETS ; do - log_mustnot eval "$ZFS allow -s @$longset $dtst" - # Create non-existent permission set - typeset timestamp=$($DATE +'%F-%R:%S') - log_mustnot $ZFS allow -s @non-existent $dtst - log_mustnot $ZFS allow $STAFF "atime,created,mounted" $dtst - log_mustnot $ZFS allow $dtst $TESTPOOL - log_mustnot $ZFS allow -c $dtst - log_mustnot $ZFS allow -u $STAFF1 $dtst - log_mustnot $ZFS allow -u $STAFF1 -g $STAFF_GROUP "create,destroy" $dtst - log_mustnot $ZFS allow -u $STAFF1 -e "mountpoint" $dtst -done - -log_pass "Invalid arguments are handled correctly." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_test.sh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_test.sh (nonexistent) @@ -1,342 +0,0 @@ -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2012 Spectra Logic. All rights reserved. -# Use is subject to license terms. -# - - -atf_test_case zfs_allow_001_pos cleanup -zfs_allow_001_pos_head() -{ - atf_set "descr" "everyone' is interpreted as a keyword even if a useror group named 'everyone' exists." - atf_set "require.progs" zfs svcs -} -zfs_allow_001_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_001_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_001_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_002_pos cleanup -zfs_allow_002_pos_head() -{ - atf_set "descr" " is interpreted as user if possible, then as group." - atf_set "require.progs" zfs svcs -} -zfs_allow_002_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_002_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_002_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_003_pos cleanup -zfs_allow_003_pos_head() -{ - atf_set "descr" "Verify option '-l' only allow permission to the dataset itself." - atf_set "require.progs" zfs svcs -} -zfs_allow_003_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_003_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_003_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_004_pos cleanup -zfs_allow_004_pos_head() -{ - atf_set "descr" "Verify option '-d' allow permission to the descendent datasets." - atf_set "require.progs" zfs svcs -} -zfs_allow_004_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_004_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_004_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_005_pos cleanup -zfs_allow_005_pos_head() -{ - atf_set "descr" "Verify option '-c' will be granted locally to the creator." - atf_set "require.progs" zfs svcs runwattr -} -zfs_allow_005_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_005_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_005_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_006_pos cleanup -zfs_allow_006_pos_head() -{ - atf_set "descr" "Changing permissions in a set will change what is allowedwherever the set is used." - atf_set "require.progs" zfs svcs -} -zfs_allow_006_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_006_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_006_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_007_pos cleanup -zfs_allow_007_pos_head() -{ - atf_set "descr" "Verify permission set can be masked on descendent dataset." - atf_set "require.progs" zfs svcs -} -zfs_allow_007_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_007_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_007_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_008_pos cleanup -zfs_allow_008_pos_head() -{ - atf_set "descr" "Verify non-root user can allow permissions." - atf_set "require.progs" zfs svcs runwattr -} -zfs_allow_008_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_008_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_008_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_009_neg cleanup -zfs_allow_009_neg_head() -{ - atf_set "descr" "Verify invalid arguments are handled correctly." - atf_set "require.progs" zfs svcs -} -zfs_allow_009_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_009_neg.ksh || atf_fail "Testcase failed" -} -zfs_allow_009_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_010_pos cleanup -zfs_allow_010_pos_head() -{ - atf_set "descr" "Verify privileged user has correct permissions once which wasdelegated to him in datasets" - atf_set "require.progs" zfs svcs -} -zfs_allow_010_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_010_pos.ksh || atf_fail "Testcase failed" -} -zfs_allow_010_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_011_neg cleanup -zfs_allow_011_neg_head() -{ - atf_set "descr" "Verify zpool subcmds and system readonly properties can't bedelegated." - atf_set "require.progs" zfs svcs -} -zfs_allow_011_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_011_neg.ksh || atf_fail "Testcase failed" -} -zfs_allow_011_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_allow_012_neg cleanup -zfs_allow_012_neg_head() -{ - atf_set "descr" "Verify privileged user can not use permissions properly whendelegation property is set off" - atf_set "require.progs" zfs zpool svcs -} -zfs_allow_012_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_allow_012_neg.ksh || atf_fail "Testcase failed" -} -zfs_allow_012_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_init_test_cases() -{ - - atf_add_test_case zfs_allow_001_pos - atf_add_test_case zfs_allow_002_pos - atf_add_test_case zfs_allow_003_pos - atf_add_test_case zfs_allow_004_pos - atf_add_test_case zfs_allow_005_pos - atf_add_test_case zfs_allow_006_pos - atf_add_test_case zfs_allow_007_pos - atf_add_test_case zfs_allow_008_pos - atf_add_test_case zfs_allow_009_neg - atf_add_test_case zfs_allow_010_pos - atf_add_test_case zfs_allow_011_neg - atf_add_test_case zfs_allow_012_neg -} Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/zfs_allow_test.sh ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/Makefile (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/Makefile (nonexistent) @@ -1,25 +0,0 @@ -# $FreeBSD$ - -.include - -PACKAGE=tests -TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/delegate/zfs_allow -FILESDIR=${TESTSDIR} - -ATF_TESTS_KSH93+= zfs_allow_test - -${PACKAGE}FILES+= zfs_allow_003_pos.ksh -${PACKAGE}FILES+= zfs_allow_007_pos.ksh -${PACKAGE}FILES+= zfs_allow_002_pos.ksh -${PACKAGE}FILES+= zfs_allow_006_pos.ksh -${PACKAGE}FILES+= zfs_allow_012_neg.ksh -${PACKAGE}FILES+= zfs_allow_009_neg.ksh -${PACKAGE}FILES+= zfs_allow_004_pos.ksh -${PACKAGE}FILES+= zfs_allow_008_pos.ksh -${PACKAGE}FILES+= zfs_allow_010_pos.ksh -${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= zfs_allow_011_neg.ksh -${PACKAGE}FILES+= zfs_allow_001_pos.ksh -${PACKAGE}FILES+= zfs_allow_005_pos.ksh - -.include Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow/Makefile ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_007_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_007_neg.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_007_neg.ksh (nonexistent) @@ -1,76 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_007_neg.ksh 1.1 07/01/09 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_007_neg -# -# DESCRIPTION: -# zfs unallow will not remove those permissions which inherited from -# its parent filesystem. -# -# STRATEGY: -# 1. Assign perm1 to $ROOT_TESTFS -# 2. Create $SUBFS and assign perm2 to it. -# 3. Verify unallow can not affect perm1 on $SUBFS -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "zfs unallow won't remove those permissions which inherited from " \ - "its parent dataset." -log_onexit restore_root_datasets - -perm1="atime,devices"; perm2="compression,checksum" -log_must $ZFS create $SUBFS -log_must $ZFS allow $STAFF1 $perm1 $ROOT_TESTFS -log_must $ZFS allow $STAFF1 $perm2 $SUBFS - -log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1 -# -# Athrough unallow the permissions which don't exists on the specific dataset -# return 0, the inherited permissions can't be removed in fact. -# -log_must $ZFS unallow -u $STAFF1 $perm1 $SUBFS -log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1 - -log_pass "Verify zfs unallow won't remove inherited permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_008_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_008_neg.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_008_neg.ksh (nonexistent) @@ -1,86 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_008_neg.ksh 1.1 07/01/09 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_008_neg -# -# DESCRIPTION: -# zfs unallow can handle invalid arguments. -# -# STRATEGY: -# 1. Set up basic test environment. -# 2. Verify zfs unallow handle invalid arguments correctly. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "zfs unallow can handle invalid arguments." -log_onexit restore_root_datasets - -function neg_test -{ - log_mustnot eval "$@ > /dev/null 2>&1" -} - -set -A badopts "everyone -e" "everyone -u $STAFF1" "everyone everyone" \ - "-c -l" "-c -d" "-c -e" "-c -s" "-r" \ - "-u -e" "-s -e" "-s -l -d" "-s @non-exist-set -l" \ - "-s @non-existen-set -d" "-s @non-existen-set -e" \ - "-r -u $STAFF1 $STAFF1" "-u $STAFF1 -g $STAFF_GROUP" \ - "-u $STAFF1 -e" - -log_must setup_unallow_testenv - -for dtst in $DATASETS ; do - log_must $ZFS allow -c create $dtst - - typeset -i i=0 - while ((i < ${#badopts[@]})); do - neg_test $ZFS unallow ${badopts[$i]} $dtst - ((i += 1)) - done - - neg_test user_run $STAFF1 $ZFS unallow $dtst -done - -log_pass "zfs unallow can handle invalid arguments passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_test.sh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_test.sh (nonexistent) @@ -1,238 +0,0 @@ -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2012 Spectra Logic. All rights reserved. -# Use is subject to license terms. -# - - -atf_test_case zfs_unallow_001_pos cleanup -zfs_unallow_001_pos_head() -{ - atf_set "descr" "Verify '-l' only removed the local permissions." - atf_set "require.progs" zfs svcs -} -zfs_unallow_001_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_001_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_001_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_002_pos cleanup -zfs_unallow_002_pos_head() -{ - atf_set "descr" "Verify '-d' only removed the descendent permissions." - atf_set "require.progs" zfs svcs -} -zfs_unallow_002_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_002_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_002_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_003_pos cleanup -zfs_unallow_003_pos_head() -{ - atf_set "descr" "Verify options '-r' and '-l'+'-d' will unallow permission tothis dataset and the descendent datasets." - atf_set "require.progs" zfs svcs -} -zfs_unallow_003_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_003_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_003_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_004_pos cleanup -zfs_unallow_004_pos_head() -{ - atf_set "descr" "Verify '-s' will remove permissions from the named set." - atf_set "require.progs" zfs svcs -} -zfs_unallow_004_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_004_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_004_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_005_pos cleanup -zfs_unallow_005_pos_head() -{ - atf_set "descr" "Verify option '-c' will remove the created permission set." - atf_set "require.progs" zfs svcs runwattr -} -zfs_unallow_005_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_005_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_005_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_006_pos cleanup -zfs_unallow_006_pos_head() -{ - atf_set "descr" "Verify option '-u', '-g' and '-e' only removed the specified typepermissions set." - atf_set "require.progs" zfs svcs -} -zfs_unallow_006_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_006_pos.ksh || atf_fail "Testcase failed" -} -zfs_unallow_006_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_007_neg cleanup -zfs_unallow_007_neg_head() -{ - atf_set "descr" "zfs unallow won't remove those permissions which inherited fromits parent dataset." - atf_set "require.progs" zfs svcs -} -zfs_unallow_007_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_007_neg.ksh || atf_fail "Testcase failed" -} -zfs_unallow_007_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zfs_unallow_008_neg cleanup -zfs_unallow_008_neg_head() -{ - atf_set "descr" "zfs unallow can handle invalid arguments." - atf_set "require.progs" zfs svcs runwattr -} -zfs_unallow_008_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zfs_unallow_008_neg.ksh || atf_fail "Testcase failed" -} -zfs_unallow_008_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/../delegate_common.kshlib - . $(atf_get_srcdir)/../delegate.cfg - - ksh93 $(atf_get_srcdir)/../cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_init_test_cases() -{ - - atf_add_test_case zfs_unallow_001_pos - atf_add_test_case zfs_unallow_002_pos - atf_add_test_case zfs_unallow_003_pos - atf_add_test_case zfs_unallow_004_pos - atf_add_test_case zfs_unallow_005_pos - atf_add_test_case zfs_unallow_006_pos - atf_add_test_case zfs_unallow_007_neg - atf_add_test_case zfs_unallow_008_neg -} Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_test.sh ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_001_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_001_pos.ksh (nonexistent) @@ -1,77 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_001_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_001_pos -# -# DESCRIPTION: -# Verify '-l' only removed the local permissions. -# -# STRATEGY: -# 1. Set up unallow test model. -# 2. Implement unallow -l to $ROOT_TESTFS or $TESTVOL -# 3. Verify '-l' only remove the local permissions. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-29) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify '-l' only removed the local permissions." -log_onexit restore_root_datasets - -log_must setup_unallow_testenv - -for dtst in $DATASETS ; do - log_must $ZFS unallow -l $STAFF1 $dtst - log_must verify_noperm $dtst $LOCAL_SET $STAFF1 - - log_must $ZFS unallow -l $OTHER1 $dtst - log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 - - log_must verify_perm $dtst $LOCAL_DESC_SET $OTHER2 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_perm $SUBFS $LOCAL_DESC_SET $OTHER1 $OTHER2 - log_must verify_perm $SUBFS $DESC_SET $STAFF2 - fi -done - -log_pass "Verify '-l' only removed the local permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_002_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_002_pos.ksh (nonexistent) @@ -1,73 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_002_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_002_pos -# -# DESCRIPTION: -# Verify '-d' only remove the permissions on descendent filesystem. - -# STRATEGY: -# 1. Set up unallow test model. -# 2. Implement unallow -d to $ROOT_TESTFS -# 3. Verify '-d' only remove the permissions on descendent filesystem. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-29) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify '-d' only removed the descendent permissions." -log_onexit restore_root_datasets - -log_must setup_unallow_testenv - -log_must $ZFS unallow -d $STAFF2 $ROOT_TESTFS -log_must verify_noperm $SUBFS $DESC_SET $STAFF2 - -log_must $ZFS unallow -d $OTHER1 $ROOT_TESTFS -log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1 -log_must verify_perm $ROOT_TESTFS $LOCAL_DESC_SET $OTHER1 - -log_must verify_perm $ROOT_TESTFS $LOCAL_DESC_SET $OTHER2 -log_must verify_perm $SUBFS $LOCAL_DESC_SET $OTHER2 - -log_pass "Verify '-d' only removed the descendent permissions passed" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_003_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_003_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_003_pos.ksh (nonexistent) @@ -1,83 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_003_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_003_pos -# -# DESCRIPTION: -# Verify options '-r' or '-l' + '-d' will unallow permission to this -# dataset and the descendent datasets. -# -# STRATEGY: -# 1. Set up unallow test model. -# 2. Implement unallow -l -d to $ROOT_TESTFS or $ROOT_TESTVOL without -# options. -# 3. Verify '-l' + '-d' will unallow local + descendent permission. -# 4. Verify '-r' will unallow local + descendent permission. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-29) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify options '-r' and '-l'+'-d' will unallow permission to " \ - "this dataset and the descendent datasets." -log_onexit restore_root_datasets - -log_must setup_unallow_testenv - -for dtst in $DATASETS ; do - log_must $ZFS unallow $STAFF1 $dtst - log_must $ZFS unallow -l -d $STAFF2 $dtst - log_must verify_noperm $dtst $LOCAL_SET $STAFF1 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_noperm $SUBFS $DESC_SET $STAFF2 - fi - - log_must $ZFS unallow -l -d $OTHER1 $dtst - log_must $ZFS unallow -r $OTHER2 $dtst - log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2 - if [[ $dtst == $ROOT_TESTFS ]]; then - log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1 $OTHER2 - fi -done - -log_pass "Verify options '-r' and '-l'+'-d' function passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_004_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_004_pos.ksh (nonexistent) @@ -1,71 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_004_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_004_pos -# -# DESCRIPTION: -# Verify '-s' will remove permissions from the named set. -# -# STRATEGY: -# 1. Set @basic set to $ROOT_TESTFS or $ROOT_TESTVOL and allow @basic -# to $STAFF1 -# 2. Verify $STAFF1 have @basic permissions. -# 3. Verify '-s' will remove permission from the named set. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-29) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify '-s' will remove permissions from the named set." -log_onexit restore_root_datasets - -for dtst in $DATASETS ; do - log_must $ZFS allow -s @basic $LOCAL_DESC_SET $dtst - log_must $ZFS allow -u $STAFF1 @basic $dtst - - log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 - log_must $ZFS unallow -s @basic $LOCAL_DESC_SET $dtst - log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1 -done - -log_pass "Verify '-s' will remove permissions from the named set passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_005_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_005_pos.ksh (nonexistent) @@ -1,85 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_005_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_005_pos -# -# DESCRIPTION: -# Verify option '-c' will remove the created permission set. -# -# STRATEGY: -# 1. Set created time set to $ROOT_TESTFS. -# 2. Allow permission create to $STAFF1 on $ROOT_TESTFS. -# 3. Create $SUBFS and verify $STAFF1 have created time permissions. -# 4. Verify $STAFF1 has created time permission. -# 5. Unallow created time permission with option '-c'. -# 6. Created $SUBFS and verify $STAFF1 have not created time permissions. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify option '-c' will remove the created permission set." -log_onexit restore_root_datasets - -log_must $ZFS allow -c $LOCAL_SET $ROOT_TESTFS -log_must $ZFS allow -l $STAFF1 create,mount $ROOT_TESTFS - -# Create $SUBFS and verify $SUBFS has created time permissions. -user_run $STAFF1 $ZFS create $SUBFS -if ! datasetexists $SUBFS ; then - log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS" -fi -log_must verify_perm $SUBFS $LOCAL_SET $STAFF1 - -# -# After unallow -c, create $SUBFS2 and verify $SUBFS2 has not created time -# permissions any more. -# -log_must $ZFS unallow -c $LOCAL_SET $ROOT_TESTFS -user_run $STAFF1 $ZFS create $SUBFS2 -if ! datasetexists $SUBFS2 ; then - log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS2" -fi -log_must verify_noperm $SUBFS2 $LOCAL_SET $STAFF1 - -log_pass "Verify option '-c' will remove the created permission set passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_006_pos.ksh (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/zfs_unallow_006_pos.ksh (nonexistent) @@ -1,83 +0,0 @@ -#!/usr/local/bin/ksh93 -p -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "@(#)zfs_unallow_006_pos.ksh 1.2 07/07/31 SMI" -# - -. $STF_SUITE/tests/delegate/delegate_common.kshlib - -################################################################################# -# -# __stc_assertion_start -# -# ID: zfs_unallow_006_pos -# -# DESCRIPTION: -# Verify option '-u', '-g' and '-e' only removed the specified type -# permissions set. -# -# STRATEGY: -# 1. Allow '-u' '-g' & '-e' to $STAFF1 on ROOT_TESTFS or $ROOT_TESTVOL. -# 2. Unallow '-u' '-g' & '-e' on $ROOT_TESTFS or $ROOT_TESTVOL separately. -# 3. Verify permissions on $ROOT_TESTFS or $ROOT_TESTVOL separately. -# -# TESTABILITY: explicit -# -# TEST_AUTOMATION_LEVEL: automated -# -# CODING_STATUS: COMPLETED (2006-09-30) -# -# __stc_assertion_end -# -################################################################################ - -verify_runnable "both" - -log_assert "Verify option '-u', '-g' and '-e' only removed the specified type "\ - "permissions set." -log_onexit restore_root_datasets - -for dtst in $DATASETS ; do - log_must $ZFS allow -u $STAFF1 $LOCAL_DESC_SET $dtst - log_must $ZFS allow -g $STAFF_GROUP $LOCAL_DESC_SET $dtst - log_must $ZFS allow -e $LOCAL_DESC_SET $dtst - - log_must verify_perm $dtst $LOCAL_DESC_SET \ - $STAFF1 $STAFF2 $OTHER1 $OTHER2 - - log_must $ZFS unallow -e $dtst - log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 $STAFF2 - log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2 - - log_must $ZFS unallow -g $STAFF_GROUP $dtst - log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 - log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF2 - - log_must $ZFS unallow -u $STAFF1 $dtst - log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1 -done - -log_pass "Verify option '-u', '-g' and '-e' passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/Makefile (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/Makefile (nonexistent) @@ -1,20 +0,0 @@ -# $FreeBSD$ - -.include - -PACKAGE=tests -TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/delegate/zfs_unallow -FILESDIR=${TESTSDIR} - -ATF_TESTS_KSH93+= zfs_unallow_test - -${PACKAGE}FILES+= zfs_unallow_003_pos.ksh -${PACKAGE}FILES+= zfs_unallow_007_neg.ksh -${PACKAGE}FILES+= zfs_unallow_006_pos.ksh -${PACKAGE}FILES+= zfs_unallow_002_pos.ksh -${PACKAGE}FILES+= zfs_unallow_004_pos.ksh -${PACKAGE}FILES+= zfs_unallow_008_neg.ksh -${PACKAGE}FILES+= zfs_unallow_005_pos.ksh -${PACKAGE}FILES+= zfs_unallow_001_pos.ksh - -.include Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow/Makefile ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/Makefile =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/Makefile (revision 329046) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/Makefile (revision 329047) @@ -1,17 +1,38 @@ # $FreeBSD$ .include PACKAGE=tests TESTSDIR=${TESTSBASE}/sys/cddl/zfs/tests/delegate FILESDIR=${TESTSDIR} +ATF_TESTS_KSH93+= zfs_allow_test +ATF_TESTS_KSH93+= zfs_unallow_test + +${PACKAGE}FILES+= cleanup.ksh +${PACKAGE}FILES+= cleanup.ksh ${PACKAGE}FILES+= delegate.cfg ${PACKAGE}FILES+= delegate_common.kshlib -${PACKAGE}FILES+= cleanup.ksh ${PACKAGE}FILES+= setup.ksh - -TESTS_SUBDIRS+= zfs_allow -TESTS_SUBDIRS+= zfs_unallow +${PACKAGE}FILES+= zfs_allow_001_pos.ksh +${PACKAGE}FILES+= zfs_allow_002_pos.ksh +${PACKAGE}FILES+= zfs_allow_003_pos.ksh +${PACKAGE}FILES+= zfs_allow_004_pos.ksh +${PACKAGE}FILES+= zfs_allow_005_pos.ksh +${PACKAGE}FILES+= zfs_allow_006_pos.ksh +${PACKAGE}FILES+= zfs_allow_007_pos.ksh +${PACKAGE}FILES+= zfs_allow_008_pos.ksh +${PACKAGE}FILES+= zfs_allow_009_neg.ksh +${PACKAGE}FILES+= zfs_allow_010_pos.ksh +${PACKAGE}FILES+= zfs_allow_011_neg.ksh +${PACKAGE}FILES+= zfs_allow_012_neg.ksh +${PACKAGE}FILES+= zfs_unallow_001_pos.ksh +${PACKAGE}FILES+= zfs_unallow_002_pos.ksh +${PACKAGE}FILES+= zfs_unallow_003_pos.ksh +${PACKAGE}FILES+= zfs_unallow_004_pos.ksh +${PACKAGE}FILES+= zfs_unallow_005_pos.ksh +${PACKAGE}FILES+= zfs_unallow_006_pos.ksh +${PACKAGE}FILES+= zfs_unallow_007_neg.ksh +${PACKAGE}FILES+= zfs_unallow_008_neg.ksh .include Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh (revision 329047) @@ -0,0 +1,117 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_001_pos.ksh 1.3 08/11/03 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_001_pos +# +# DESCRIPTION: +# "everyone" is interpreted as the keyword "everyone" whatever the same +# name user or group is existing. +# +# STRATEGY: +# 1. Create user 'everyone'. +# 2. Verify 'everyone' is interpreted as keywords. +# 3. Create group 'everyone'. +# 4. Verify 'everyone' is interpreted as keywords. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-14) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +function cleanup +{ + if [[ $user_added == "TRUE" ]] ; then + del_user everyone + fi + if [[ $group_added == "TRUE" ]] ; then + del_group everyone + fi + + restore_root_datasets +} + +log_assert "everyone' is interpreted as a keyword even if a user " \ + "or group named 'everyone' exists." +log_onexit cleanup + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms="snapshot,reservation,compression,send,allow,\ +userprop" +else + typeset perms="snapshot,reservation,compression,checksum,\ +send,allow,userprop" +fi + +log_note "Create a user called 'everyone'." +if ! $ID everyone > /dev/null 2>&1; then + user_added="TRUE" + log_must $USERADD everyone +fi +for dtst in $DATASETS ; do + log_must $ZFS allow everyone $perms $dtst + log_must verify_perm $dtst $perms $EVERYONE "everyone" +done +log_must restore_root_datasets +if [[ $user_added == "TRUE" ]]; then + log_must $USERDEL everyone +fi + +log_note "Created a group called 'everyone'." +if ! $CAT /etc/group | $AWK -F: '{print $1}' | \ + $GREP -w 'everyone' > /dev/null 2>&1 +then + group_added="TRUE" + log_must $GROUPADD everyone +fi + +for dtst in $DATASETS ; do + log_must $ZFS allow everyone $perms $dtst + log_must verify_perm $dtst $perms $EVERYONE +done +log_must restore_root_datasets +if [[ $group_added == "TRUE" ]]; then + log_must $GROUPDEL everyone +fi + +log_pass "everyone is always interpreted as keyword passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh (revision 329047) @@ -0,0 +1,98 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_002_pos.ksh 1.3 08/11/03 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_002_pos +# +# DESCRIPTION: +# argument is interpreted as a user if possible, then as a group as +# possible. +# +# STRATEGY: +# 1. Create user $STAFF_GROUP +# 2. Delegate permissions to $STAFF_GROUP +# 3. Verify user $STAFF_GROUP has the permissions. +# 4. Delete user $STAFF_GROUP and allow the permission to $STAFF_GROUP +# 5. Verify $STAFF_GROUP is interpreted as group. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-14) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +function cleanup +{ + if $ID $STAFF_GROUP > /dev/null 2>&1; then + log_must del_user $STAFF_GROUP + fi + + restore_root_datasets +} + +log_assert " is interpreted as user if possible, then as group." +log_onexit cleanup + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms="snapshot,reservation,compression,send,allow,\ +userprop" +else + typeset perms="snapshot,reservation,compression,checksum,\ +send,allow,userprop" +fi + +log_must $USERADD $STAFF_GROUP +for dtst in $DATASETS ; do + log_must $ZFS allow $STAFF_GROUP $perms $dtst + log_must verify_perm $dtst $perms $STAFF_GROUP + log_must verify_noperm $dtst $perms $STAFF1 $STAFF2 +done + +log_must restore_root_datasets + +log_must del_user $STAFF_GROUP +for dtst in $datasets ; do + log_must $ZFS allow $STAFF_GROUP $perms $dtst + log_must verify_perm $dtst $perms $STAFF1 $STAFF2 +done + +log_pass " is interpreted as user if possible, then as group passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh (revision 329047) @@ -0,0 +1,116 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_003_pos.ksh 1.4 09/08/06 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_003_pos +# +# DESCRIPTION: +# Verify option '-l' only allow permission to the dataset itself. +# +# STRATEGY: +# 1. Create descendent datasets of $ROOT_TESTFS +# 2. Select user, group and everyone and set local permission separately. +# 3. Set locally permissions to $ROOT_TESTFS or $ROOT_TESTVOL. +# 4. Verify the permissions are only allow on $ROOT_TESTFS or +# $ROOT_TESTVOL. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-19) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify option '-l' only allow permission to the dataset itself." +log_onexit restore_root_datasets + +childfs=$ROOT_TESTFS/childfs + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms="snapshot,reservation,compression,allow,\ +userprop" +else + typeset perms="snapshot,reservation,compression,checksum,\ +allow,userprop" +fi + +if check_version "5.10" ; then + perms="${perms},send" +fi + +log_must $ZFS create $childfs + +for dtst in $DATASETS ; do + log_must $ZFS allow -l $STAFF1 $perms $dtst + log_must verify_perm $dtst $perms $STAFF1 + if [[ $dtst == $ROOT_TESTFS ]] ; then + log_must verify_noperm $childfs $perms \ + $STAFF1 $STAFF2 $OTHER1 $OTHER2 + fi +done + +log_must restore_root_datasets + +log_must $ZFS create $childfs +for dtst in $DATASETS ; do + log_must $ZFS allow -l -g $STAFF_GROUP $perms $dtst + log_must verify_perm $dtst $perms $STAFF1 $STAFF2 + if [[ $dtst == $ROOT_TESTFS ]] ; then + log_must verify_noperm $childfs $perms \ + $STAFF1 $STAFF2 $OTHER1 $OTHER2 + fi +done + +log_must restore_root_datasets + +log_must $ZFS create $childfs +for dtst in $DATASETS ; do + log_must $ZFS allow -l -e $perms $dtst + log_must verify_perm $dtst $perms $STAFF1 $STAFF2 $OTHER1 $OTHER2 + if [[ $dtst == $ROOT_TESTFS ]] ; then + log_must verify_noperm $childfs $perms \ + $STAFF1 $STAFF2 $OTHER1 $OTHER2 + fi +done + +log_must restore_root_datasets + +log_pass "Verify option '-l' only allow permission to the dataset itself pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_004_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_004_pos.ksh (revision 329047) @@ -0,0 +1,119 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_004_pos.ksh 1.4 09/08/06 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_004_pos +# +# DESCRIPTION: +# Verify option '-d' allow permission to the descendent datasets, and not +# for this dataset itself. +# +# STRATEGY: +# 1. Create descendent datasets of $ROOT_TESTFS +# 2. Select user, group and everyone and set descendent permission +# separately. +# 3. Set descendent permissions to $ROOT_TESTFS or $ROOT_TESTVOL. +# 4. Verify those permissions are allowed to $ROOT_TESTFS's +# descendent dataset. +# 5. Verify the permissions are not allowed to $ROOT_TESTFS or +# $ROOT_TESTVOL. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-18) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify option '-d' allow permission to the descendent datasets." +log_onexit restore_root_datasets + +childfs=$ROOT_TESTFS/childfs + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms="snapshot,reservation,compression,allow,\ +userprop" +else + typeset perms="snapshot,reservation,compression,checksum,\ +allow,userprop" +fi + +if check_version "5.10" ; then + perms="${perms},send" +fi + +# Verify option '-d' only affect sub-datasets +log_must $ZFS create $childfs +for dtst in $DATASETS ; do + log_must $ZFS allow -d $STAFF1 $perms $dtst + log_must verify_noperm $dtst $perms $STAFF1 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_perm $childfs $perms $STAFF1 + fi +done + +log_must restore_root_datasets + +# Verify option '-d + -g' affect group in sub-datasets. +log_must $ZFS create $childfs +for dtst in $DATASETS ; do + log_must $ZFS allow -d -g $STAFF_GROUP $perms $dtst + log_must verify_noperm $dtst $perms $STAFF2 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_perm $childfs $perms $STAFF2 + fi +done + +log_must restore_root_datasets + +# Verify option '-d + -e' affect everyone in sub-datasets. +log_must $ZFS create $childfs +for dtst in $DATASETS ; do + log_must $ZFS allow -d -e $perms $dtst + log_must verify_noperm $dtst $perms $OTHER1 $OTHER2 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_perm $childfs $perms $OTHER1 $OTHER2 + fi +done + +log_must restore_root_datasets + +log_pass "Verify option '-d' allow permission to the descendent datasets pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_005_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_005_pos.ksh (revision 329047) @@ -0,0 +1,101 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_005_pos.ksh 1.4 09/08/06 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_005_pos +# +# DESCRIPTION: +# Verify option '-c' will be granted locally to the creator on any +# newly-created descendent file systems. +# +# STRATEGY: +# 1. Allow create permissions to everyone on $ROOT_TESTFS locally. +# 2. Allow '-c' create to $ROOT_TESTFS. +# 3. chmod 777 the mountpoint of $ROOT_TESTFS +# 4. Verify only creator can create descendent dataset on +# $ROOT_TESTFS/$user. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-19) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify option '-c' will be granted locally to the creator." +log_onexit restore_root_datasets + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms="snapshot,reservation,compression,allow,\ +userprop" +else + typeset perms="snapshot,reservation,compression,checksum,\ +allow,userprop" +fi + +if check_version "5.10" ; then + perms="${perms},send" +fi + +log_must $ZFS allow -l everyone create,mount $ROOT_TESTFS +log_must $ZFS allow -c $perms $ROOT_TESTFS + +mntpnt=$(get_prop mountpoint $ROOT_TESTFS) +log_must $CHMOD 777 $mntpnt + +for user in $EVERYONE; do + childfs=$ROOT_TESTFS/$user + + user_run $user $ZFS create $childfs + + for other in $EVERYONE; do + # + # Verify only the creator has the $perm time permissions. + # + if [[ $other == $user ]]; then + log_must verify_perm $childfs $perms $user + else + log_must verify_noperm $childfs $perms $other + fi + done +done + +log_pass "Verify option '-c' will be granted locally to the creator passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_006_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_006_pos.ksh (revision 329047) @@ -0,0 +1,89 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_006_pos.ksh 1.2 08/11/03 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_006_pos +# +# DESCRIPTION: +# Changing permissions in a set will change what is allowed wherever the +# set is used. +# +# STRATEGY: +# 1. Set create as set @basic. +# 2. Allow set @basic to $STAFF1 on $ROOT_TESTFS or $ROOT_TESTVOL +# 3. Verify $STAFF1 has create permissions. +# 4. Reset snapshot,allow to $basic +# 5. Verify now $STAFF1 have create,allow,destroy permissions. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-19) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Changing permissions in a set will change what is allowed " \ + "wherever the set is used." +log_onexit restore_root_datasets + +fs1=$ROOT_TESTFS/fs1; fs2=$ROOT_TESTFS/fs2 +log_must $ZFS create $fs1 +log_must $ZFS create $fs2 + +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + perms1="snapshot,checksum,reservation" +else + perms1="snapshot,reservation" +fi + +for dtst in $DATASETS $fs1 $fs2; do + log_must $ZFS allow -s @basic $perms1 $dtst + log_must $ZFS allow $STAFF1 @basic $dtst + log_must verify_perm $dtst $perms1 $STAFF1 +done + +perms2="allow,send,compression,userprop" +for dtst in $DATASETS $fs1 $fs2; do + log_must $ZFS allow -s @basic $perms2 $dtst + log_must verify_perm $dtst ${perms1},${perms2} $STAFF1 +done + +log_pass "Changing permissions in a set will change what is allowed passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh (revision 329047) @@ -0,0 +1,120 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_007_pos.ksh 1.3 08/11/03 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_007_pos +# +# DESCRIPTION: +# Verify the permissions set will be masked on its descendent +# datasets by same name set. +# +# STRATEGY: +# 1. Create $ROOT_TESTFS/childfs +# 2. Set permission $perms1 to @set on $ROOT_TESTFS +# 3. Reset permission $perms2 to @set on $ROOT_TESTFS/childfs +# 4. Allow @set to $STAFF1 on $ROOT_TESTFS/childfs +# 5. Verify $perms2 is delegated on $ROOT_TESTFS/childfs and its +# descendent. +# 6. Allow @set to $STAFF1 on $ROOT_TESTFS +# 7. Verify $perms1 is not appended to $STAFF1 on $ROOT_TESTFS/childfs and +# its descendent since it is masked +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-19) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify permission set can be masked on descendent dataset." +log_onexit restore_root_datasets + +typeset perms1="snapshot,reservation,compression" +eval set -A dataset $DATASETS +enc=$(get_prop encryption $dataset) +if [[ $? -eq 0 ]] && [[ -n "$enc" ]] && [[ "$enc" != "off" ]]; then + typeset perms2="send,allow,userprop" +else + typeset perms2="checksum,send,allow,userprop" +fi + +# +# Define three level filesystems +# +childfs=$ROOT_TESTFS/childfs +grandchild=$childfs/grandchild +log_must $ZFS create $childfs +log_must $ZFS create $grandchild + +# +# Setting different permissions to the same set on two level. +# But only assign the user at one level. +# +log_must $ZFS allow -s @set $perms1 $ROOT_TESTFS +log_must $ZFS allow -s @set $perms2 $childfs +log_must $ZFS allow $STAFF1 @set $childfs + +# +# Verify only perms2 is valid to user on the level which he was assigned. +# +log_must verify_noperm $ROOT_TESTFS $perms1 $STAFF1 +for fs in $childfs $grandchild ; do + log_must verify_noperm $childfs $perms1 $STAFF1 + log_must verify_perm $childfs $perms2 $STAFF1 +done + +# +# Delegate @set to STAFF1 on ROOT_TESTFS, verify $perms1 will not be appended +# to its descendent datasets since it is masked +# +log_must $ZFS allow $STAFF1 @set $ROOT_TESTFS +log_must verify_perm $ROOT_TESTFS $perms1 $STAFF1 +for fs in $childfs $grandchild ; do + log_must verify_noperm $childfs $perms1 $STAFF1 + log_must verify_perm $childfs $perms2 $STAFF1 +done + +# Remove the mask, $perms1 will be allowed to its descendent datasets +log_must $ZFS unallow -s @set $childfs +for fs in $childfs $grandchild ; do + log_must verify_noperm $childfs $perms2 $STAFF1 + log_must verify_perm $childfs $perms1 $STAFF1 +done + +log_pass "Verify permission set can be masked on descendetn dataset pass." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_008_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_008_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_008_pos.ksh (revision 329047) @@ -0,0 +1,90 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_008_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_008_pos +# +# DESCRIPTION: +# non-root user can allow any permissions which he is holding to +# other else user when it get 'allow' permission. +# +# STRATEGY: +# 1. Set two set permissions to two datasets locally. +# 2. Verify the non-root user can allow permission if he has allow +# permission. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-20) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify non-root user can allow permissions." +log_onexit restore_root_datasets + +perms1="snapshot,reservation" +perms2="send,compression,checksum,userprop" +childfs=$ROOT_TESTFS/childfs + +log_must $ZFS create $childfs + +for dtst in $DATASETS ; do + # Delegate local permission to $STAFF1 + log_must $ZFS allow -l $STAFF1 $perms1 $dtst + log_must $ZFS allow -l $STAFF1 allow $dtst + + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must $ZFS allow -l $STAFF1 $perms2 $childfs + # $perms1 is local permission in $ROOT_TESTFS + log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms1 $childfs + log_must verify_noperm $childfs $perms1 $OTHER1 + fi + + # Verify 'allow' give non-privilege user delegated permission. + log_must user_run $STAFF1 $ZFS allow -l $OTHER1 $perms1 $dtst + log_must verify_perm $dtst $perms1 $OTHER1 + + # $perms2 was not allow to $STAFF1, so he have no permission to + # delegate permission to other else. + log_mustnot user_run $STAFF1 $ZFS allow $OTHER1 $perms2 $dtst + log_must verify_noperm $dtst $perms2 $OTHER1 +done + +log_pass "Verify non-root user can allow permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_009_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_009_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_009_neg.ksh (revision 329047) @@ -0,0 +1,76 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_009_neg.ksh 1.1 07/01/09 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_009_neg +# +# DESCRIPTION: +# zfs allow can deal with invalid arguments.(Invalid options or combination) +# +# STRATEGY: +# 1. Verify invalid argumets will cause error. +# 2. Verify non-optional argument was missing will cause error. +# 3. Verify invalid options cause error. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-20) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify invalid arguments are handled correctly." +log_onexit restore_root_datasets + +# Permission sets are limited to 64 characters in length. +longset="set123456789012345678901234567890123456789012345678901234567890123" +for dtst in $DATASETS ; do + log_mustnot eval "$ZFS allow -s @$longset $dtst" + # Create non-existent permission set + typeset timestamp=$($DATE +'%F-%R:%S') + log_mustnot $ZFS allow -s @non-existent $dtst + log_mustnot $ZFS allow $STAFF "atime,created,mounted" $dtst + log_mustnot $ZFS allow $dtst $TESTPOOL + log_mustnot $ZFS allow -c $dtst + log_mustnot $ZFS allow -u $STAFF1 $dtst + log_mustnot $ZFS allow -u $STAFF1 -g $STAFF_GROUP "create,destroy" $dtst + log_mustnot $ZFS allow -u $STAFF1 -e "mountpoint" $dtst +done + +log_pass "Invalid arguments are handled correctly." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh (revision 329047) @@ -0,0 +1,126 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_010_pos.ksh 1.3 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_010_pos +# +# DESCRIPTION: +# Scan the following permissions one by one to verify privileged user +# has correct permission delegation in datasets. +# +# STRATEGY: +# 1. Delegate all the permission one by one to user on dataset. +# 2. Verify privileged user has correct permission without any other +# permissions allowed. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-11-02) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify privileged user has correct permissions once which was "\ + "delegated to him in datasets" +log_onexit restore_root_datasets + +# +# Results in Results in +# Permission Filesystem Volume +# +set -A perms create true false \ + snapshot true true \ + mount true false \ + send true true \ + allow true true \ + quota true false \ + reservation true true \ + recordsize true false \ + mountpoint true false \ + checksum true true \ + compression true true \ + canmount true false \ + atime true false \ + devices true false \ + exec true false \ + volsize false true \ + setuid true false \ + readonly true true \ + snapdir true false \ + userprop true true \ + aclmode true false \ + aclinherit true false \ + rollback true true \ + clone true true \ + rename true true \ + promote true true \ + zoned true false \ + shareiscsi true true \ + xattr true false \ + receive true false \ + destroy true true +if is_global_zone; then + typeset -i n=${#perms[@]} + perms[((n))]="sharenfs"; perms[((n+1))]="true"; perms[((n+2))]="false" + perms[((n+3))]="share"; perms[((n+4))]="true"; perms[((n+5))]="false" +fi + +for dtst in $DATASETS; do + typeset -i k=1 + typeset type=$(get_prop type $dtst) + [[ $type == "volume" ]] && k=2 + + typeset -i i=0 + while (( i < ${#perms[@]} )); do + log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst + + if [[ ${perms[((i+k))]} == "true" ]]; then + log_must verify_perm $dtst ${perms[$i]} $STAFF1 + else + log_must verify_noperm $dtst ${perms[$i]} $STAFF1 + fi + + log_must restore_root_datasets + + ((i += 3)) + done +done + +log_pass "Verify privileged user has correct permissions " \ + "in datasets passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_011_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_011_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_011_neg.ksh (revision 329047) @@ -0,0 +1,80 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_011_neg.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_011_neg +# +# DESCRIPTION: +# Verify zpool subcmds and system readonly properties can't be delegated. +# +# STRATEGY: +# 1. Loop all the zpool subcmds and readonly properties, except permission +# 'create' & 'destroy'. +# 2. Verify those subcmd or properties can't be delegated. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-12-13) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify zpool subcmds and system readonly properties can't be " \ + "delegated." +log_onexit restore_root_datasets + +set -A invalid_perms \ + add remove list iostat \ + status offline online clear \ + attach detach replace scrub \ + export import upgrade \ + type creation used available \ + referenced compressratio mounted + +for dtst in $DATASETS ; do + typeset -i i=0 + + while ((i < ${#invalid_perms[@]})); do + log_mustnot $ZFS allow $STAFF1 ${invalid_perms[$i]} $dtst + + ((i += 1)) + done +done + +log_pass "Verify zpool subcmds and system readonly properties passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh (revision 329047) @@ -0,0 +1,91 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_allow_012_neg.ksh 1.1 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_allow_012_neg +# +# DESCRIPTION: +# Scan all permissions one by one to verify privileged user +# can not use permissions properly when delegation property is set off +# +# STRATEGY: +# 1. Delegate all the permission one by one to user on dataset. +# 2. Verify privileged user can not use permissions properly when +# delegation property is off +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2007-06-19) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "global" + +function cleanup +{ + log_must $ZPOOL set delegation=on $TESTPOOL + log_must restore_root_datasets +} + +log_assert "Verify privileged user can not use permissions properly when " \ + "delegation property is set off" +log_onexit cleanup + + +set -A perms create snapshot mount send allow quota reservation \ + recordsize mountpoint checksum compression canmount atime \ + devices exec volsize setuid readonly snapdir userprop \ + aclmode aclinherit rollback clone rename promote \ + zoned shareiscsi xattr receive destroy sharenfs share + +log_must $ZPOOL set delegation=off $TESTPOOL + +for dtst in $DATASETS; do + typeset -i i=0 + while (( i < ${#perms[@]} )); do + + log_must $ZFS allow $STAFF1 ${perms[$i]} $dtst + log_must verify_noperm $dtst ${perms[$i]} $STAFF1 + + log_must restore_root_datasets + ((i += 1)) + done +done + +log_pass "Verify privileged user can not use permissions properly when " \ + "delegation property is set off" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh (revision 329047) @@ -0,0 +1,342 @@ +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2012 Spectra Logic. All rights reserved. +# Use is subject to license terms. +# + + +atf_test_case zfs_allow_001_pos cleanup +zfs_allow_001_pos_head() +{ + atf_set "descr" "everyone' is interpreted as a keyword even if a useror group named 'everyone' exists." + atf_set "require.progs" zfs svcs +} +zfs_allow_001_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_001_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_001_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_002_pos cleanup +zfs_allow_002_pos_head() +{ + atf_set "descr" " is interpreted as user if possible, then as group." + atf_set "require.progs" zfs svcs +} +zfs_allow_002_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_002_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_002_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_003_pos cleanup +zfs_allow_003_pos_head() +{ + atf_set "descr" "Verify option '-l' only allow permission to the dataset itself." + atf_set "require.progs" zfs svcs +} +zfs_allow_003_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_003_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_003_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_004_pos cleanup +zfs_allow_004_pos_head() +{ + atf_set "descr" "Verify option '-d' allow permission to the descendent datasets." + atf_set "require.progs" zfs svcs +} +zfs_allow_004_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_004_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_004_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_005_pos cleanup +zfs_allow_005_pos_head() +{ + atf_set "descr" "Verify option '-c' will be granted locally to the creator." + atf_set "require.progs" zfs svcs runwattr +} +zfs_allow_005_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_005_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_005_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_006_pos cleanup +zfs_allow_006_pos_head() +{ + atf_set "descr" "Changing permissions in a set will change what is allowedwherever the set is used." + atf_set "require.progs" zfs svcs +} +zfs_allow_006_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_006_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_006_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_007_pos cleanup +zfs_allow_007_pos_head() +{ + atf_set "descr" "Verify permission set can be masked on descendent dataset." + atf_set "require.progs" zfs svcs +} +zfs_allow_007_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_007_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_007_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_008_pos cleanup +zfs_allow_008_pos_head() +{ + atf_set "descr" "Verify non-root user can allow permissions." + atf_set "require.progs" zfs svcs runwattr +} +zfs_allow_008_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_008_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_008_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_009_neg cleanup +zfs_allow_009_neg_head() +{ + atf_set "descr" "Verify invalid arguments are handled correctly." + atf_set "require.progs" zfs svcs +} +zfs_allow_009_neg_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_009_neg.ksh || atf_fail "Testcase failed" +} +zfs_allow_009_neg_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_010_pos cleanup +zfs_allow_010_pos_head() +{ + atf_set "descr" "Verify privileged user has correct permissions once which wasdelegated to him in datasets" + atf_set "require.progs" zfs svcs +} +zfs_allow_010_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_010_pos.ksh || atf_fail "Testcase failed" +} +zfs_allow_010_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_011_neg cleanup +zfs_allow_011_neg_head() +{ + atf_set "descr" "Verify zpool subcmds and system readonly properties can't bedelegated." + atf_set "require.progs" zfs svcs +} +zfs_allow_011_neg_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_011_neg.ksh || atf_fail "Testcase failed" +} +zfs_allow_011_neg_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_allow_012_neg cleanup +zfs_allow_012_neg_head() +{ + atf_set "descr" "Verify privileged user can not use permissions properly whendelegation property is set off" + atf_set "require.progs" zfs zpool svcs +} +zfs_allow_012_neg_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_allow_012_neg.ksh || atf_fail "Testcase failed" +} +zfs_allow_012_neg_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_init_test_cases() +{ + + atf_add_test_case zfs_allow_001_pos + atf_add_test_case zfs_allow_002_pos + atf_add_test_case zfs_allow_003_pos + atf_add_test_case zfs_allow_004_pos + atf_add_test_case zfs_allow_005_pos + atf_add_test_case zfs_allow_006_pos + atf_add_test_case zfs_allow_007_pos + atf_add_test_case zfs_allow_008_pos + atf_add_test_case zfs_allow_009_neg + atf_add_test_case zfs_allow_010_pos + atf_add_test_case zfs_allow_011_neg + atf_add_test_case zfs_allow_012_neg +} Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_001_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_001_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_001_pos.ksh (revision 329047) @@ -0,0 +1,77 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_001_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_001_pos +# +# DESCRIPTION: +# Verify '-l' only removed the local permissions. +# +# STRATEGY: +# 1. Set up unallow test model. +# 2. Implement unallow -l to $ROOT_TESTFS or $TESTVOL +# 3. Verify '-l' only remove the local permissions. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-29) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify '-l' only removed the local permissions." +log_onexit restore_root_datasets + +log_must setup_unallow_testenv + +for dtst in $DATASETS ; do + log_must $ZFS unallow -l $STAFF1 $dtst + log_must verify_noperm $dtst $LOCAL_SET $STAFF1 + + log_must $ZFS unallow -l $OTHER1 $dtst + log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 + + log_must verify_perm $dtst $LOCAL_DESC_SET $OTHER2 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_perm $SUBFS $LOCAL_DESC_SET $OTHER1 $OTHER2 + log_must verify_perm $SUBFS $DESC_SET $STAFF2 + fi +done + +log_pass "Verify '-l' only removed the local permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_002_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_002_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_002_pos.ksh (revision 329047) @@ -0,0 +1,73 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_002_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_002_pos +# +# DESCRIPTION: +# Verify '-d' only remove the permissions on descendent filesystem. + +# STRATEGY: +# 1. Set up unallow test model. +# 2. Implement unallow -d to $ROOT_TESTFS +# 3. Verify '-d' only remove the permissions on descendent filesystem. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-29) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify '-d' only removed the descendent permissions." +log_onexit restore_root_datasets + +log_must setup_unallow_testenv + +log_must $ZFS unallow -d $STAFF2 $ROOT_TESTFS +log_must verify_noperm $SUBFS $DESC_SET $STAFF2 + +log_must $ZFS unallow -d $OTHER1 $ROOT_TESTFS +log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1 +log_must verify_perm $ROOT_TESTFS $LOCAL_DESC_SET $OTHER1 + +log_must verify_perm $ROOT_TESTFS $LOCAL_DESC_SET $OTHER2 +log_must verify_perm $SUBFS $LOCAL_DESC_SET $OTHER2 + +log_pass "Verify '-d' only removed the descendent permissions passed" Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_003_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_003_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_003_pos.ksh (revision 329047) @@ -0,0 +1,83 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_003_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_003_pos +# +# DESCRIPTION: +# Verify options '-r' or '-l' + '-d' will unallow permission to this +# dataset and the descendent datasets. +# +# STRATEGY: +# 1. Set up unallow test model. +# 2. Implement unallow -l -d to $ROOT_TESTFS or $ROOT_TESTVOL without +# options. +# 3. Verify '-l' + '-d' will unallow local + descendent permission. +# 4. Verify '-r' will unallow local + descendent permission. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-29) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify options '-r' and '-l'+'-d' will unallow permission to " \ + "this dataset and the descendent datasets." +log_onexit restore_root_datasets + +log_must setup_unallow_testenv + +for dtst in $DATASETS ; do + log_must $ZFS unallow $STAFF1 $dtst + log_must $ZFS unallow -l -d $STAFF2 $dtst + log_must verify_noperm $dtst $LOCAL_SET $STAFF1 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_noperm $SUBFS $DESC_SET $STAFF2 + fi + + log_must $ZFS unallow -l -d $OTHER1 $dtst + log_must $ZFS unallow -r $OTHER2 $dtst + log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2 + if [[ $dtst == $ROOT_TESTFS ]]; then + log_must verify_noperm $SUBFS $LOCAL_DESC_SET $OTHER1 $OTHER2 + fi +done + +log_pass "Verify options '-r' and '-l'+'-d' function passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_004_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_004_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_004_pos.ksh (revision 329047) @@ -0,0 +1,71 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_004_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_004_pos +# +# DESCRIPTION: +# Verify '-s' will remove permissions from the named set. +# +# STRATEGY: +# 1. Set @basic set to $ROOT_TESTFS or $ROOT_TESTVOL and allow @basic +# to $STAFF1 +# 2. Verify $STAFF1 have @basic permissions. +# 3. Verify '-s' will remove permission from the named set. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-29) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify '-s' will remove permissions from the named set." +log_onexit restore_root_datasets + +for dtst in $DATASETS ; do + log_must $ZFS allow -s @basic $LOCAL_DESC_SET $dtst + log_must $ZFS allow -u $STAFF1 @basic $dtst + + log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 + log_must $ZFS unallow -s @basic $LOCAL_DESC_SET $dtst + log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1 +done + +log_pass "Verify '-s' will remove permissions from the named set passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_005_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_005_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_005_pos.ksh (revision 329047) @@ -0,0 +1,85 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_005_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_005_pos +# +# DESCRIPTION: +# Verify option '-c' will remove the created permission set. +# +# STRATEGY: +# 1. Set created time set to $ROOT_TESTFS. +# 2. Allow permission create to $STAFF1 on $ROOT_TESTFS. +# 3. Create $SUBFS and verify $STAFF1 have created time permissions. +# 4. Verify $STAFF1 has created time permission. +# 5. Unallow created time permission with option '-c'. +# 6. Created $SUBFS and verify $STAFF1 have not created time permissions. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-30) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify option '-c' will remove the created permission set." +log_onexit restore_root_datasets + +log_must $ZFS allow -c $LOCAL_SET $ROOT_TESTFS +log_must $ZFS allow -l $STAFF1 create,mount $ROOT_TESTFS + +# Create $SUBFS and verify $SUBFS has created time permissions. +user_run $STAFF1 $ZFS create $SUBFS +if ! datasetexists $SUBFS ; then + log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS" +fi +log_must verify_perm $SUBFS $LOCAL_SET $STAFF1 + +# +# After unallow -c, create $SUBFS2 and verify $SUBFS2 has not created time +# permissions any more. +# +log_must $ZFS unallow -c $LOCAL_SET $ROOT_TESTFS +user_run $STAFF1 $ZFS create $SUBFS2 +if ! datasetexists $SUBFS2 ; then + log_fail "ERROR: ($STAFF1): $ZFS create $SUBFS2" +fi +log_must verify_noperm $SUBFS2 $LOCAL_SET $STAFF1 + +log_pass "Verify option '-c' will remove the created permission set passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_006_pos.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_006_pos.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_006_pos.ksh (revision 329047) @@ -0,0 +1,83 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_006_pos.ksh 1.2 07/07/31 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_006_pos +# +# DESCRIPTION: +# Verify option '-u', '-g' and '-e' only removed the specified type +# permissions set. +# +# STRATEGY: +# 1. Allow '-u' '-g' & '-e' to $STAFF1 on ROOT_TESTFS or $ROOT_TESTVOL. +# 2. Unallow '-u' '-g' & '-e' on $ROOT_TESTFS or $ROOT_TESTVOL separately. +# 3. Verify permissions on $ROOT_TESTFS or $ROOT_TESTVOL separately. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-30) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "Verify option '-u', '-g' and '-e' only removed the specified type "\ + "permissions set." +log_onexit restore_root_datasets + +for dtst in $DATASETS ; do + log_must $ZFS allow -u $STAFF1 $LOCAL_DESC_SET $dtst + log_must $ZFS allow -g $STAFF_GROUP $LOCAL_DESC_SET $dtst + log_must $ZFS allow -e $LOCAL_DESC_SET $dtst + + log_must verify_perm $dtst $LOCAL_DESC_SET \ + $STAFF1 $STAFF2 $OTHER1 $OTHER2 + + log_must $ZFS unallow -e $dtst + log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 $STAFF2 + log_must verify_noperm $dtst $LOCAL_DESC_SET $OTHER1 $OTHER2 + + log_must $ZFS unallow -g $STAFF_GROUP $dtst + log_must verify_perm $dtst $LOCAL_DESC_SET $STAFF1 + log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF2 + + log_must $ZFS unallow -u $STAFF1 $dtst + log_must verify_noperm $dtst $LOCAL_DESC_SET $STAFF1 +done + +log_pass "Verify option '-u', '-g' and '-e' passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh (revision 329047) @@ -0,0 +1,76 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_007_neg.ksh 1.1 07/01/09 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_007_neg +# +# DESCRIPTION: +# zfs unallow will not remove those permissions which inherited from +# its parent filesystem. +# +# STRATEGY: +# 1. Assign perm1 to $ROOT_TESTFS +# 2. Create $SUBFS and assign perm2 to it. +# 3. Verify unallow can not affect perm1 on $SUBFS +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-30) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "zfs unallow won't remove those permissions which inherited from " \ + "its parent dataset." +log_onexit restore_root_datasets + +perm1="atime,devices"; perm2="compression,checksum" +log_must $ZFS create $SUBFS +log_must $ZFS allow $STAFF1 $perm1 $ROOT_TESTFS +log_must $ZFS allow $STAFF1 $perm2 $SUBFS + +log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1 +# +# Athrough unallow the permissions which don't exists on the specific dataset +# return 0, the inherited permissions can't be removed in fact. +# +log_must $ZFS unallow -u $STAFF1 $perm1 $SUBFS +log_must verify_perm $SUBFS ${perm1},${perm2} $STAFF1 + +log_pass "Verify zfs unallow won't remove inherited permissions passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_008_neg.ksh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_008_neg.ksh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_008_neg.ksh (revision 329047) @@ -0,0 +1,86 @@ +#!/usr/local/bin/ksh93 -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "@(#)zfs_unallow_008_neg.ksh 1.1 07/01/09 SMI" +# + +. $STF_SUITE/tests/delegate/delegate_common.kshlib + +################################################################################# +# +# __stc_assertion_start +# +# ID: zfs_unallow_008_neg +# +# DESCRIPTION: +# zfs unallow can handle invalid arguments. +# +# STRATEGY: +# 1. Set up basic test environment. +# 2. Verify zfs unallow handle invalid arguments correctly. +# +# TESTABILITY: explicit +# +# TEST_AUTOMATION_LEVEL: automated +# +# CODING_STATUS: COMPLETED (2006-09-30) +# +# __stc_assertion_end +# +################################################################################ + +verify_runnable "both" + +log_assert "zfs unallow can handle invalid arguments." +log_onexit restore_root_datasets + +function neg_test +{ + log_mustnot eval "$@ > /dev/null 2>&1" +} + +set -A badopts "everyone -e" "everyone -u $STAFF1" "everyone everyone" \ + "-c -l" "-c -d" "-c -e" "-c -s" "-r" \ + "-u -e" "-s -e" "-s -l -d" "-s @non-exist-set -l" \ + "-s @non-existen-set -d" "-s @non-existen-set -e" \ + "-r -u $STAFF1 $STAFF1" "-u $STAFF1 -g $STAFF_GROUP" \ + "-u $STAFF1 -e" + +log_must setup_unallow_testenv + +for dtst in $DATASETS ; do + log_must $ZFS allow -c create $dtst + + typeset -i i=0 + while ((i < ${#badopts[@]})); do + neg_test $ZFS unallow ${badopts[$i]} $dtst + ((i += 1)) + done + + neg_test user_run $STAFF1 $ZFS unallow $dtst +done + +log_pass "zfs unallow can handle invalid arguments passed." Index: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh =================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh (nonexistent) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh (revision 329047) @@ -0,0 +1,238 @@ +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2012 Spectra Logic. All rights reserved. +# Use is subject to license terms. +# + + +atf_test_case zfs_unallow_001_pos cleanup +zfs_unallow_001_pos_head() +{ + atf_set "descr" "Verify '-l' only removed the local permissions." + atf_set "require.progs" zfs svcs +} +zfs_unallow_001_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_001_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_001_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_002_pos cleanup +zfs_unallow_002_pos_head() +{ + atf_set "descr" "Verify '-d' only removed the descendent permissions." + atf_set "require.progs" zfs svcs +} +zfs_unallow_002_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_002_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_002_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_003_pos cleanup +zfs_unallow_003_pos_head() +{ + atf_set "descr" "Verify options '-r' and '-l'+'-d' will unallow permission tothis dataset and the descendent datasets." + atf_set "require.progs" zfs svcs +} +zfs_unallow_003_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_003_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_003_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_004_pos cleanup +zfs_unallow_004_pos_head() +{ + atf_set "descr" "Verify '-s' will remove permissions from the named set." + atf_set "require.progs" zfs svcs +} +zfs_unallow_004_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_004_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_004_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_005_pos cleanup +zfs_unallow_005_pos_head() +{ + atf_set "descr" "Verify option '-c' will remove the created permission set." + atf_set "require.progs" zfs svcs runwattr +} +zfs_unallow_005_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_005_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_005_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_006_pos cleanup +zfs_unallow_006_pos_head() +{ + atf_set "descr" "Verify option '-u', '-g' and '-e' only removed the specified typepermissions set." + atf_set "require.progs" zfs svcs +} +zfs_unallow_006_pos_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_006_pos.ksh || atf_fail "Testcase failed" +} +zfs_unallow_006_pos_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_007_neg cleanup +zfs_unallow_007_neg_head() +{ + atf_set "descr" "zfs unallow won't remove those permissions which inherited fromits parent dataset." + atf_set "require.progs" zfs svcs +} +zfs_unallow_007_neg_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_007_neg.ksh || atf_fail "Testcase failed" +} +zfs_unallow_007_neg_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_test_case zfs_unallow_008_neg cleanup +zfs_unallow_008_neg_head() +{ + atf_set "descr" "zfs unallow can handle invalid arguments." + atf_set "require.progs" zfs svcs runwattr +} +zfs_unallow_008_neg_body() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + ksh93 $(atf_get_srcdir)/zfs_unallow_008_neg.ksh || atf_fail "Testcase failed" +} +zfs_unallow_008_neg_cleanup() +{ + . $(atf_get_srcdir)/../../include/default.cfg + . $(atf_get_srcdir)/delegate_common.kshlib + . $(atf_get_srcdir)/delegate.cfg + + ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" +} + + +atf_init_test_cases() +{ + + atf_add_test_case zfs_unallow_001_pos + atf_add_test_case zfs_unallow_002_pos + atf_add_test_case zfs_unallow_003_pos + atf_add_test_case zfs_unallow_004_pos + atf_add_test_case zfs_unallow_005_pos + atf_add_test_case zfs_unallow_006_pos + atf_add_test_case zfs_unallow_007_neg + atf_add_test_case zfs_unallow_008_neg +} Property changes on: projects/zfsd/head/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property