fstests: use _require_symlinks on all necessary tests
[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 _supported_os Linux
26
27 _require_scratch
28 _require_acls
29 _acl_setup_ids
30 _do_die_on_error=y
31 test=$SCRATCH_MNT/test
32
33 # make filesystem on scratch using the defaults
34 _do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs'
35 _do 'mount filesytem' '_try_scratch_mount'
36
37 # create test files and set acls
38 acls="
39 u::r--,g::rwx,o::rw-
40 u::r-x,g::---,o::---
41 u::---,g::r-x,o::---
42 u::---,g::---,o::r-x
43 u::---,g::r-x,o::rwx
44 u::---,g::---,o::---,u:$acl2:r-x,m::rwx
45 u::rwx,g::r-x,o::r--
46 u::---,g::---,o::---,g:$acl2:r-x,m::-w-"
47
48 i=0
49 for acl in $acls
50 do
51   _do "touch $test.$i"
52   _do "chacl $acl $test.$i"
53   let i=$i+1
54 done
55
56 list_acls()
57 {
58   i=0
59   for acl in $acls
60   do
61     chacl -l $test.$i | _acl_filter_id | sed -e "s!$SCRATCH_MNT!\$SCRATCH_MNT!"
62     let i=$i+1
63   done
64 }
65
66 echo "acls before repair:"
67 list_acls
68 _do 'repair filesystem' '_check_scratch_fs'
69 echo "acls after repair: "
70 list_acls
71
72 # success, all done
73 status=0; exit