Adding devices for rizzo to do xfs-qa
[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 #
10 # creator
11 owner=tes@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20
21 # get standard environment, filters and checks
22 . ./common.rc
23 . ./common.filter
24 . ./common.attr
25
26 # real QA test starts here
27 _supported_fs xfs
28 _supported_os Linux
29
30 [ -x /usr/bin/chacl ] || _notrun "chacl executable not found"
31
32 _need_to_be_root
33 _acl_requirements
34 _require_scratch
35
36 # set up fs for 1K inodes
37 isize=0
38 _scratch_mkfs_xfs | _filter_mkfs >$seq.full 2>$tmp.mkfs
39 [ $? -eq 0 ] && source $tmp.mkfs
40 if [ "$isize" -lt 1024 ]; then
41     _scratch_mkfs_xfs -i size=1024 >>$here/$seq.full \
42         || _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
43 fi
44 _scratch_mount >>$here/$seq.full || _fail "mount failed"
45 xfs_info $SCRATCH_MNT >>$here/$seq.full
46 cd $SCRATCH_MNT
47
48 echo ""
49 echo "=== Test out large ACLs  ==="
50
51 mkdir largeacldir
52
53 # John Trostel reported probs with going from 20 to 21 aces
54 # 20 ace ACL = 20*12+4 = 244 bytes
55 # 21 ace ACL = 21*12+4 = 256 bytes - too big for shortform
56 # the 21 ace ACL can not be shortform
57 #
58 acl20=`_create_n_aces 20`
59 acl21=`_create_n_aces 21`
60
61 echo "try 20 aces for access acl"
62 chacl $acl20 largeacldir
63 getfacl largeacldir | _filter_aces
64
65 echo "try 20 aces for default acl"
66 chacl -d $acl20 largeacldir
67 getfacl largeacldir | _filter_aces
68
69 echo "try 21 aces for access acl"
70 chacl $acl21 largeacldir
71 getfacl largeacldir | _filter_aces
72
73 echo "try 21 aces for default acl"
74 chacl -d $acl21 largeacldir
75 getfacl largeacldir | _filter_aces
76
77 # success, all done
78 status=0
79 exit