generic: test deadlock on O_DIRECT|O_DSYNC
[xfstests-dev.git] / tests / generic / 314
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 314
6 #
7 # Test SGID inheritance on subdirectories
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1       # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs generic
30 _require_test
31 _require_user
32
33 rm -rf $TEST_DIR/$seq-dir
34
35 # Make dir owned by qa user, and an unrelated group:
36 mkdir $TEST_DIR/$seq-dir
37 chown $qa_user:12345 $TEST_DIR/$seq-dir
38
39 # Make parent dir sgid
40 chmod 2775 $TEST_DIR/$seq-dir
41
42 # Make subdir
43 su $qa_user -c "umask 022; mkdir $TEST_DIR/$seq-dir/subdir"
44
45 # Subdir should have inherited sgid
46 _ls_l $TEST_DIR/$seq-dir/ | grep -v total | _filter_test_dir | awk '{print $1,$NF}'
47
48 status=0
49 exit