dfe159e7cff7d7d89eab451d0480465c6671bc23
[xfstests-dev.git] / 077
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 #
19 #-----------------------------------------------------------------------
20 #
21 # FS QA Test No. 077
22 #
23 # Check use of ACLs (extended attributes) on a full filesystem
24 #
25 # creator
26 owner=nathans@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1
34 #filler=$here/../../linux
35 filler=/home/fsgqa/isms/2.4.x-xfs
36
37 _cleanup()
38 {
39         cd /
40         echo "*** unmount"
41         umount $SCRATCH_MNT 2>/dev/null
42 }
43 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
44
45 # get standard environment, filters and checks
46 . ./common.rc
47 . ./common.filter
48
49 # real QA test starts here
50 _supported_fs xfs
51 _supported_os Linux
52
53 [ ! -d $filler ] && _notrun "No linux directory to source files from"
54
55 _require_scratch
56
57 echo "*** create filesystem"
58
59 rm -f $seq.full
60 umount $SCRATCH_DEV >/dev/null 2>&1
61 echo "*** MKFS ***"                         >>$seq.full
62 echo ""                                     >>$seq.full
63 _scratch_mkfs_xfs -dsize=50m                >>$seq.full 2>&1 \
64         || _fail "mkfs failed"
65 _scratch_mount                              >>$seq.full 2>&1 \
66         || _fail "mount failed"
67 mkdir $SCRATCH_MNT/subdir
68
69 echo "*** set default ACL"
70 setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx $SCRATCH_MNT/subdir
71
72 echo "*** populate filesystem, pass #1" | tee -a $seq.full
73 cp -rf $filler $SCRATCH_MNT/subdir >$seq.full 2>&1
74
75 echo "*** populate filesystem, pass #2" | tee -a $seq.full
76 cp -rf $filler $SCRATCH_MNT/subdir >$seq.full 2>&1
77
78 _check_scratch_fs
79
80 echo "*** all done"
81 rm -f $seq.full
82 status=0
83 exit