reflink: ensure that we can handle reflinking a lot of extents
[xfstests-dev.git] / tests / generic / 237
1 #! /bin/bash
2 # FS QA Test No. 237
3 #
4 # Check user B can setfacl a file which belongs to user A
5 # See also http://marc.info/?l=linux-btrfs&m=127434445620298&w=2
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2010 FUJITSU LIMITED. All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 runas=$here/src/runas
33 status=1        # FAILure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common/rc
38 . ./common/filter
39 . ./common/attr
40
41 _cleanup()
42 {
43         cd /
44         rm -f $tmp.*
45         [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
46 }
47
48 # real QA test starts here
49 _supported_fs generic
50 # only Linux supports fallocate
51 _supported_os Linux
52 _require_test
53
54 [ -x $runas ] || _notrun "$runas executable not found"
55
56 rm -f $seqres.full
57
58 _need_to_be_root
59 _acl_setup_ids
60 _require_acls
61
62 # get dir
63 cd $TEST_DIR
64 rm -rf $seq.dir1
65 mkdir $seq.dir1
66 cd $seq.dir1
67
68 touch file1
69 chown $acl1.$acl1 file1
70
71 echo "Expect to FAIL"
72 $runas -u $acl2 -g $acl2 -- setfacl -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/'
73
74 echo "Test over."
75 # success, all done
76 status=0
77 exit