xfstests: move generic tests out of top level dir
[xfstests-dev.git] / tests / generic / 077
1 #! /bin/bash
2 # FS QA Test No. 077
3 #
4 # Check use of ACLs (extended attributes) on a full filesystem
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2003 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
25 seq=`basename $0`
26 echo "QA output created by $seq"
27
28 here=`pwd`
29 tmp=/tmp/$$
30 status=1
31 # Something w/ enough data to fill 50M of fs...
32 filler=/lib/modules/
33
34 _cleanup()
35 {
36         cd /
37         echo "*** unmount"
38         umount $SCRATCH_MNT 2>/dev/null
39 }
40 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
41
42 # get standard environment, filters and checks
43 . ./common.rc
44 . ./common.filter
45 . ./common.attr
46
47 # real QA test starts here
48 _supported_fs generic
49 _supported_os Linux
50
51 [ ! -d $filler ] && _notrun "No directory to source files from"
52
53 _require_attrs
54 _require_acls
55 _require_user
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 SIZE=`expr 50 \* 1024 \* 1024`
64 _scratch_mkfs_sized $SIZE                   >>$seq.full 2>&1 \
65         || _fail "mkfs failed"
66 _scratch_mount                              >>$seq.full 2>&1 \
67         || _fail "mount failed"
68 mkdir $SCRATCH_MNT/subdir
69
70 echo "*** set default ACL"
71 setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx $SCRATCH_MNT/subdir
72
73 echo "*** populate filesystem, pass #1" | tee -a $seq.full
74 cp -rf $filler $SCRATCH_MNT/subdir >$seq.full 2>&1
75
76 echo "*** populate filesystem, pass #2" | tee -a $seq.full
77 cp -rf $filler $SCRATCH_MNT/subdir >$seq.full 2>&1
78
79 _check_scratch_fs
80
81 echo "*** all done"
82 rm -f $seq.full
83 status=0
84 exit