common: kill _supported_os
[xfstests-dev.git] / tests / generic / 053
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 053
6 #
7 # xfs_repair breaks acls
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21 . ./common/attr
22
23 # real QA test starts here
24 _supported_fs generic
25
26 _require_scratch
27 _require_acls
28 _acl_setup_ids
29 _do_die_on_error=y
30 test=$SCRATCH_MNT/test
31
32 # make filesystem on scratch using the defaults
33 _do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs'
34 _do 'mount filesytem' '_try_scratch_mount'
35
36 # create test files and set acls
37 acls="
38 u::r--,g::rwx,o::rw-
39 u::r-x,g::---,o::---
40 u::---,g::r-x,o::---
41 u::---,g::---,o::r-x
42 u::---,g::r-x,o::rwx
43 u::---,g::---,o::---,u:$acl2:r-x,m::rwx
44 u::rwx,g::r-x,o::r--
45 u::---,g::---,o::---,g:$acl2:r-x,m::-w-"
46
47 i=0
48 for acl in $acls
49 do
50   _do "touch $test.$i"
51   _do "chacl $acl $test.$i"
52   let i=$i+1
53 done
54
55 list_acls()
56 {
57   i=0
58   for acl in $acls
59   do
60     chacl -l $test.$i | _acl_filter_id | sed -e "s!$SCRATCH_MNT!\$SCRATCH_MNT!"
61     let i=$i+1
62   done
63 }
64
65 echo "acls before repair:"
66 list_acls
67 _do 'repair filesystem' '_check_scratch_fs'
68 echo "acls after repair: "
69 list_acls
70
71 # success, all done
72 status=0; exit