generic/520: Remove sync in clean_dir
[xfstests-dev.git] / tests / generic / 364
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test 364
6 #
7 # RichACL basic test
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 "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/attr
27
28 # remove previous $seqres.full before test
29 rm -f $seqres.full
30
31 # real QA test starts here
32
33 _supported_fs generic
34 _supported_os Linux
35
36 _require_scratch
37 _require_scratch_richacl
38 _require_richacl_prog
39
40 _scratch_mkfs_richacl >> $seqres.full
41 _scratch_mount
42
43 cd $SCRATCH_MNT
44
45 umask 022
46
47 touch x
48
49 $SETRICHACL_PROG --set 'everyone@:rwp::allow' x
50 stat -c %A x
51 $GETRICHACL_PROG x
52
53 chmod 664 x
54 stat -c %A x
55 $GETRICHACL_PROG x
56
57 # Note that unlike how the test cases look at first sight, we do *not* require
58 # a richacl-enabled version of ls here ...
59
60 mkdir sub
61 $SETRICHACL_PROG --set 'everyone@:rwpxd:fd:allow' sub
62 stat -c %A+ sub
63 _getfattr -m system\.richacl sub
64
65 chmod 775 sub
66 stat -c %A+ sub
67 _getfattr -m system\.richacl sub
68 $GETRICHACL_PROG sub
69
70 touch sub/f
71 stat -c %A sub/f
72 $GETRICHACL_PROG sub/f
73
74 mkdir sub/sub2
75 stat -c %A+ sub/sub2
76 $GETRICHACL_PROG sub/sub2
77
78 mkdir -m 750 sub/sub3
79 stat -c %A+ sub/sub3
80 $GETRICHACL_PROG sub/sub3
81
82 # success, all done
83 status=0
84 exit