tests: remove udf/101
[xfstests-dev.git] / tests / overlay / 025
1 #! /bin/bash
2 # FS QA Test 025
3 #
4 # Overlayfs failed to get posix acls if lower or upper
5 # fs is tmpfs.
6 # Kernel commit below fixed it.
7 # 5201dc449e4b ovl: use cached acl on underlying layer
8 #
9 # This reproducer was originally written by
10 #     Miklos Szeredi <mszeredi@redhat.com>
11 #
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
14 #
15 # This program is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation.
18 #
19 # This program is distributed in the hope that it would be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write the Free Software Foundation,
26 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
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 trap "_cleanup; exit \$status" 0 1 2 3 15
38
39 _cleanup()
40 {
41         cd /
42         $UMOUNT_PROG $tmpfsdir/mnt
43         $UMOUNT_PROG $tmpfsdir
44         rm -rf $tmpfsdir
45         rm -f $tmp.*
46 }
47
48 # get standard environment, filters and checks
49 . ./common/rc
50 . ./common/filter
51
52 # remove previous $seqres.full before test
53 rm -f $seqres.full
54
55 # real QA test starts here
56
57 # Modify as appropriate.
58 _supported_fs overlay
59 _supported_os Linux
60 _require_user
61 _require_tmpfs
62
63 # create a tmpfs in $TEST_DIR
64 tmpfsdir=$TEST_DIR/tmpfs
65 mkdir -p $tmpfsdir
66 $MOUNT_PROG -t tmpfs tmpfs $tmpfsdir
67
68 mkdir -p $tmpfsdir/{lower,upper,work,mnt}
69 mkdir -p -m 0 $tmpfsdir/upper/testd
70 # grant permission for $qa_user
71 setfacl -m u:$qa_user:rx $tmpfsdir/upper/testd
72
73 # mount overlay using dirs in tmpfs
74 _overlay_mount_dirs $tmpfsdir/{lower,upper,work,overlay,mnt}
75
76 # user accessing test dir, should be OKay
77 _user_do "ls $tmpfsdir/mnt/testd"
78
79 echo "Silence is golden"
80 # success, all done
81 status=0
82 exit