generic: Verify the inheritance behavior of FS_XFLAG_DAX flag in various combinations
[xfstests-dev.git] / tests / generic / 237
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 FUJITSU LIMITED. All Rights Reserved.
4 #
5 # FS QA Test No. 237
6 #
7 # Check user B can setfacl a file which belongs to user A
8 # See also http://marc.info/?l=linux-btrfs&m=127434445620298&w=2
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # FAILure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 # get standard environment, filters and checks
20 . ./common/rc
21 . ./common/filter
22 . ./common/attr
23
24 _cleanup()
25 {
26         cd /
27         rm -f $tmp.*
28         [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
29 }
30
31 # real QA test starts here
32 _supported_fs generic
33 # only Linux supports fallocate
34 _supported_os Linux
35 _require_test
36 _require_runas
37
38 rm -f $seqres.full
39
40 _acl_setup_ids
41 _require_acls
42
43 # get dir
44 cd $TEST_DIR
45 rm -rf $seq.dir1
46 mkdir $seq.dir1
47 cd $seq.dir1
48
49 touch file1
50 chown $acl1.$acl1 file1
51
52 echo "Expect to FAIL"
53 _runas -u $acl2 -g $acl2 -- setfacl -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/'
54
55 echo "Test over."
56 # success, all done
57 status=0
58 exit