generic: test adding filesystem-level fscrypt key via key_id
[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_os Linux
36 _supported_fs generic
37 _require_acls
38 _require_scratch
39
40 rm -f $seqres.full
41
42 _scratch_mkfs > /dev/null 2>&1
43 _scratch_mount
44
45 mkdir $SCRATCH_MNT/testdir
46 setfacl -d --set u::rwx,g::rwx,o::- $SCRATCH_MNT/testdir
47 getfacl -n --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
48
49 mkdir $SCRATCH_MNT/testdir/testsubdir
50 getfacl -n --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
51
52 # success, all done
53 status=0
54 exit