generic/077: fall back to /usr if /lib/modules doesn't exist
[xfstests-dev.git] / tests / generic / 319
1 #! /bin/bash
2 # FS QA Test No. generic/319
3 #
4 # Regression test to make sure a directory inherits the default ACL from
5 # its parent directory. This test was motivated by an issue reported by
6 # a btrfs user. That issue is fixed and described by the following btrfs
7 # kernel patch:
8 #
9 #     https://patchwork.kernel.org/patch/3046931/
10 #
11 #-----------------------------------------------------------------------
12 # Copyright (c) 2013 Filipe Manana.  All Rights Reserved.
13 #
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation.
17 #
18 # This program is distributed in the hope that it would be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write the Free Software Foundation,
25 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
26 #
27 #-----------------------------------------------------------------------
28 #
29
30 seq=`basename $0`
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
33
34 here=`pwd`
35 tmp=/tmp/$$
36 status=1        # FAILure is the default!
37
38 _cleanup()
39 {
40        rm -f $tmp.*
41 }
42
43 trap "_cleanup ; exit \$status" 0 1 2 3 15
44
45 # get standard environment, filters and checks
46 . ./common/rc
47 . ./common/filter
48 . ./common/attr
49
50 # real QA test starts here
51 _supported_os Linux
52 _supported_fs generic
53 _require_acls
54 _require_scratch
55 _need_to_be_root
56
57 rm -f $seqres.full
58
59 _scratch_mkfs > /dev/null 2>&1
60 _scratch_mount
61
62 mkdir $SCRATCH_MNT/testdir
63 setfacl -d --set u::rwx,g::rwx,o::- $SCRATCH_MNT/testdir
64 getfacl --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
65
66 mkdir $SCRATCH_MNT/testdir/testsubdir
67 getfacl --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
68
69 # success, all done
70 status=0
71 exit