5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
23 . $STF_SUITE/include/libtest.shlib
27 # Verify that ACLs survive remount.
30 # 1. Test presence of default and regular ACLs after remount
31 # a. Can set and list ACL before remount
32 # b. Can list ACL after remount
35 verify_runnable "both"
36 log_assert "Verify regular and default POSIX ACLs survive remount"
38 typeset acl_str1="^group:$ZFS_ACL_STAFF_GROUP:-wx$"
39 typeset acl_str2="^default:group:$ZFS_ACL_STAFF_GROUP:-wx$"
40 typeset ACLDIR="$TESTDIR/dir.1"
42 log_note "Testing access to DIRECTORY"
43 log_must mkdir $ACLDIR
44 log_must setfacl -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
45 log_must setfacl -d -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
46 getfacl $ACLDIR 2> /dev/null | egrep -q "$acl_str1"
47 if [ "$?" -eq "0" ]; then
48 getfacl $ACLDIR 2> /dev/null | egrep -q "$acl_str2"
51 if [ "$?" -eq "0" ]; then
52 log_must zfs unmount $TESTPOOL/$TESTFS
53 log_must zfs mount $TESTPOOL/$TESTFS
54 log_must eval "getfacl $ACLDIR 2> /dev/null | egrep -q \"$acl_str1\""
55 log_must eval "getfacl $ACLDIR 2> /dev/null | egrep -q \"$acl_str2\""
56 log_pass "POSIX ACLs survive remount"
58 log_fail "Group '$ZFS_ACL_STAFF_GROUP' does not have 'rwx'"