generic: test for non-zero used blocks while writing into a file
[xfstests-dev.git] / tests / generic / 319
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Filipe Manana.  All Rights Reserved.
4 #
5 # FS QA Test No. generic/319
6 #
7 # Regression test to make sure a directory inherits the default ACL from
8 # its parent directory. This test was motivated by an issue reported by
9 # a btrfs user. That issue is fixed and described by the following btrfs
10 # kernel patch:
11 #
12 #     https://patchwork.kernel.org/patch/3046931/
13 #
14 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # FAILure is the default!
21
22 _cleanup()
23 {
24        rm -f $tmp.*
25 }
26
27 trap "_cleanup ; exit \$status" 0 1 2 3 15
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32 . ./common/attr
33
34 # real QA test starts here
35 _supported_fs generic
36 _require_acls
37 _require_scratch
38
39 rm -f $seqres.full
40
41 _scratch_mkfs > /dev/null 2>&1
42 _scratch_mount
43
44 mkdir $SCRATCH_MNT/testdir
45 setfacl -d --set u::rwx,g::rwx,o::- $SCRATCH_MNT/testdir
46 getfacl -n --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
47
48 mkdir $SCRATCH_MNT/testdir/testsubdir
49 getfacl -n --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
50
51 # success, all done
52 status=0
53 exit