lib/: spdx license conversion
[xfstests-dev.git] / tests / generic / 362
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 362
6 #
7 # RichACL apply-masks 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
27 # remove previous $seqres.full before test
28 rm -f $seqres.full
29
30 # real QA test starts here
31
32 _supported_fs generic
33 _supported_os Linux
34
35 _require_scratch
36 _require_scratch_richacl
37 _require_richacl_prog
38
39 _scratch_mkfs_richacl >> $seqres.full
40 _scratch_mount
41
42 cd $SCRATCH_MNT
43
44 touch x
45 $SETRICHACL_PROG --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x
46 $GETRICHACL_PROG x
47
48 $SETRICHACL_PROG --set 'everyone@:wp::allow owner@:r::allow group@:r::allow' x
49 chmod 664 x
50 $GETRICHACL_PROG x
51
52 $SETRICHACL_PROG --set 'everyone@:wp::deny owner@:rwp::allow group@:rwp::allow' x
53 chmod 664 x
54 $GETRICHACL_PROG x
55
56 $SETRICHACL_PROG --set 'owner@:rwCo::allow' x
57 $GETRICHACL_PROG x
58
59 $SETRICHACL_PROG --set 'owner@:rwpCo::allow' x
60 $GETRICHACL_PROG x
61
62 chmod 644 x
63 $GETRICHACL_PROG x
64
65 $SETRICHACL_PROG --set 'u:77:rwp::allow' x
66 chmod 664 x
67 $GETRICHACL_PROG x
68
69 chmod 644 x
70 $GETRICHACL_PROG --numeric-ids x
71
72 chmod 664 x
73 $GETRICHACL_PROG x
74
75 $SETRICHACL_PROG --set 'u:77:rwp::allow everyone@:r::allow' x
76 chmod 664 x
77 $GETRICHACL_PROG x
78
79 $SETRICHACL_PROG --set 'u:77:r::allow everyone@:rwp::allow' x
80 chmod 664 x
81 $GETRICHACL_PROG x
82
83 $SETRICHACL_PROG --set 'u:77:wp::deny everyone@:rwp::allow' x
84 chmod 664 x
85 $GETRICHACL_PROG x
86
87 $SETRICHACL_PROG --set 'u:77:rwp::allow u:77:wp::deny everyone@:rwp::allow' x
88 chmod 664 x
89 $GETRICHACL_PROG x
90
91 $SETRICHACL_PROG --set 'everyone@:rwp::allow' x
92 chmod 066 x
93 $GETRICHACL_PROG x
94
95 chmod 006 x
96 $GETRICHACL_PROG x
97
98 chmod 606 x
99 $GETRICHACL_PROG x
100
101 $SETRICHACL_PROG --set 'u:77:rwp::allow everyone@:rwp::allow' x
102 chmod 606 x
103 $GETRICHACL_PROG x
104
105 chmod 646 x
106 $GETRICHACL_PROG x
107
108 # success, all done
109 status=0
110 exit