generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / generic / 444
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 SUSE Linux.  All Rights Reserved.
4 #
5 # FS QA Test 444
6 #
7 # Check if SGID is inherited when creating a subdirectory when the owner is not
8 # in the owning group and directory has default ACLs.
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 _cleanup()
20 {
21         cd /
22         rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/attr
29
30 # real QA test starts here
31 _supported_fs generic
32 _supported_os Linux
33 _require_test
34 _require_runas
35 _require_acls
36
37 cd $TEST_DIR
38
39 TDIR=testdir.$seq
40
41 # Create SGID directory with default ACLs
42 rm -rf $TDIR
43 mkdir $TDIR
44 setfacl -d -m u:101:rwx $TDIR
45 chown 100:100 $TDIR
46 chmod 2755 $TDIR
47
48 _runas -u 100 -g 100 -- mkdir $TDIR/testsub1
49 stat -c %A $TDIR/testsub1
50 _runas -u 100 -g 101 -- mkdir $TDIR/testsub2
51 stat -c %A $TDIR/testsub2
52
53 status=0
54 exit