generic: test for file loss after mix of rename, fsync and inode eviction
[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 . ./common/preamble
11 _begin_fstest auto quick acl
12
13 # Import common functions.
14 . ./common/filter
15 . ./common/attr
16
17 # Override the default cleanup function.
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22         [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
23 }
24
25 # real QA test starts here
26 _supported_fs generic
27 # only Linux supports fallocate
28 _require_test
29 _require_runas
30
31 _acl_setup_ids
32 _require_acls
33
34 # get dir
35 cd $TEST_DIR
36 rm -rf $seq.dir1
37 mkdir $seq.dir1
38 cd $seq.dir1
39
40 touch file1
41 chown $acl1.$acl1 file1
42
43 echo "Expect to FAIL"
44 _runas -u $acl2 -g $acl2 -- setfacl -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/'
45
46 echo "Test over."
47 # success, all done
48 status=0
49 exit