xfstests 240: test non-aligned AIO hole-filling
[xfstests-dev.git] / 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 # creator
26 owner=shiwh@cn.fujitsu.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 runas=$here/src/runas
34 status=1        # FAILure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
36
37 # get standard environment, filters and checks
38 . ./common.rc
39 . ./common.filter
40 . ./common.attr
41
42 _cleanup()
43 {
44         cd /
45         rm -f $tmp.*
46         [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
47         _cleanup_testdir
48 }
49
50 # real QA test starts here
51 _supported_fs generic
52 # only Linux supports fallocate
53 _supported_os Linux
54
55 [ -x $runas ] || _notrun "$runas executable not found"
56
57 rm -f $seq.full
58
59 _setup_testdir
60
61 _need_to_be_root
62 _acl_setup_ids
63 _require_acls
64
65 # get dir
66 cd $testdir
67 rm -rf $seq.dir1
68 mkdir $seq.dir1
69 cd $seq.dir1
70
71 touch file1
72 chown $acl1.$acl1 file1
73
74 echo "Expect to FAIL"
75 $runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1
76
77 echo "Test over."
78 # success, all done
79 status=0
80 exit