Add GPL license plate to SGI's files.
[xfstests-dev.git] / 067
1 #! /bin/sh
2 # FS QA Test No. 067
3 #
4 # Test out acl/dacls which fit in shortform in the inode
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 #
22 #-----------------------------------------------------------------------
23 #
24 # creator
25 owner=tes@sgi.com
26
27 seq=`basename $0`
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38 . ./common.attr
39
40 # real QA test starts here
41 _supported_fs xfs
42 _supported_os Linux
43
44 [ -x /usr/bin/chacl ] || _notrun "chacl executable not found"
45
46 _need_to_be_root
47 _acl_requirements
48 _require_scratch
49
50 # set up fs for 1K inodes
51 isize=0
52 _scratch_mkfs_xfs | _filter_mkfs >$seq.full 2>$tmp.mkfs
53 [ $? -eq 0 ] && source $tmp.mkfs
54 if [ "$isize" -lt 1024 ]; then
55     _scratch_mkfs_xfs -i size=1024 >>$here/$seq.full \
56         || _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
57 fi
58 _scratch_mount >>$here/$seq.full || _fail "mount failed"
59 xfs_info $SCRATCH_MNT >>$here/$seq.full
60 cd $SCRATCH_MNT
61
62 echo ""
63 echo "=== Test out large ACLs  ==="
64
65 mkdir largeacldir
66
67 # John Trostel reported probs with going from 20 to 21 aces
68 # 20 ace ACL = 20*12+4 = 244 bytes
69 # 21 ace ACL = 21*12+4 = 256 bytes - too big for shortform
70 # the 21 ace ACL can not be shortform
71 #
72 acl20=`_create_n_aces 20`
73 acl21=`_create_n_aces 21`
74
75 echo "try 20 aces for access acl"
76 chacl $acl20 largeacldir
77 getfacl largeacldir | _filter_aces
78
79 echo "try 20 aces for default acl"
80 chacl -d $acl20 largeacldir
81 getfacl largeacldir | _filter_aces
82
83 echo "try 21 aces for access acl"
84 chacl $acl21 largeacldir
85 getfacl largeacldir | _filter_aces
86
87 echo "try 21 aces for default acl"
88 chacl -d $acl21 largeacldir
89 getfacl largeacldir | _filter_aces
90
91 # success, all done
92 status=0
93 exit