overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / overlay / 023
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 023
6 #
7 # The "work" directory in an overlyfs workdir should not inherit
8 # ACL attrs from workdir.
9 # Kernel commits below fix it.
10 #   c11b9fdd6a61 ovl: remove posix_acl_default from workdir
11 #   e1ff3dd1ae52 ovl: fix workdir creation
12 #
13 # This reproducer was originally written by
14 #     Miklos Szeredi <mszeredi@redhat.com>
15 #
16 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27         cd /
28         rm -f $tmp.*
29 }
30
31 # get standard environment, filters and checks
32 . ./common/rc
33 . ./common/filter
34 . ./common/attr
35
36 # remove previous $seqres.full before test
37 rm -f $seqres.full
38
39 # real QA test starts here
40
41 # Modify as appropriate.
42 _supported_fs overlay
43 _supported_os Linux
44 _require_acls
45 _require_scratch
46
47 # Remove all files from previous tests
48 _scratch_mkfs
49
50 # setting acls before mount
51 wkdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
52 mkdir -p $wkdir
53 setfacl -d -m o::rwx $wkdir
54
55 _scratch_mount
56
57 # getting acls, ACL set on workdir should be cleaned
58 getfacl -n -p $wkdir/work 2>&1 | _filter_scratch | _filter_ovl_dirs
59
60 # success, all done
61 status=0
62 exit