xfstests: remove stale machine configs
[xfstests-dev.git] / 053
1 #! /bin/bash
2 # FS QA Test No. 053
3 #
4 # xfs_repair breaks acls
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
25 seq=`basename $0`
26 echo "QA output created by $seq"
27
28 here=`pwd`
29 tmp=/tmp/$$
30 status=1        # failure is the default!
31 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
32
33 # get standard environment, filters and checks
34 . ./common.rc
35 . ./common.filter
36 . ./common.attr
37
38 # real QA test starts here
39 _supported_fs generic
40 _supported_os Linux
41
42 _require_scratch
43 _require_acls
44 _acl_setup_ids
45 _do_die_on_error=y
46 test=$SCRATCH_MNT/test
47
48 # make filesystem on scratch using the defaults
49 _do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs'
50 _do 'mount filesytem' '_scratch_mount'
51
52 # create test files and set acls
53 acls="
54 u::r--,g::rwx,o::rw-
55 u::r-x,g::---,o::---
56 u::---,g::r-x,o::---
57 u::---,g::---,o::r-x
58 u::---,g::r-x,o::rwx
59 u::---,g::---,o::---,u:$acl2:r-x,m::rwx
60 u::rwx,g::r-x,o::r--
61 u::---,g::---,o::---,g:$acl2:r-x,m::-w-"
62
63 i=0
64 for acl in $acls
65 do
66   _do "touch $test.$i"
67   _do "chacl $acl $test.$i"
68   let i=$i+1
69 done
70
71 list_acls()
72 {
73   i=0
74   for acl in $acls
75   do
76     chacl -l $test.$i | _acl_filter_id | sed -e "s!$SCRATCH_MNT!\$SCRATCH_MNT!"
77     let i=$i+1
78   done
79 }
80
81 echo "acls before repair:"
82 list_acls
83 _do 'unmount $SCRATCH_DEV' 'umount $SCRATCH_DEV'
84 _do 'repair filesystem' '_check_scratch_fs'
85 _do 'mount filesytem' '_scratch_mount'
86 echo "acls after repair: "
87 list_acls
88
89 # success, all done
90 status=0; exit