xfs/144: Use _qsetup instead of qsetup
[xfstests-dev.git] / tests / overlay / 011
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 011
6 #
7 # test overlay private xattr on overlayfs with multiple lower dirs, all the
8 # lower layers except the lowest one should honor overlay private xattr
9 # "trusted.overlay", which means it should not be visible to user.
10 #
11 # Commit b581755b1c56 ("ovl: xattr filter fix") fixed this issue.
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         cd /
25         rm -f $tmp.*
26 }
27
28 # get standard environment, filters and checks
29 . ./common/rc
30 . ./common/filter
31 . ./common/attr
32
33 rm -f $seqres.full
34
35 # real QA test starts here
36 _supported_fs overlay
37 _require_test
38 _require_scratch
39 _require_attrs trusted
40
41 # Remove all files from previous tests
42 _scratch_mkfs
43
44 # Create test dir on upper and make it opaque by setting proper xattr
45 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
46 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
47 mkdir -p $lowerdir/testdir
48 mkdir -p $upperdir/testdir
49 $SETFATTR_PROG -n "trusted.overlay.opaque" -v "y" $upperdir/testdir
50
51 # mount overlay with multiple lowerdirs, with $lowerdir as the lowest dir and
52 # $upperdir overlaid on top of $lowerdir, so that "trusted.overlay.opaque"
53 # xattr should be honored and should not be listed
54 # mount readonly, because there's no upper and workdir
55 $MOUNT_PROG -t overlay -o ro -o lowerdir=$upperdir:$lowerdir $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT
56
57 # Dump trusted.overlay xattr, we should not see the "opaque" xattr
58 _getfattr -d -m overlay $SCRATCH_MNT/testdir
59 echo "Silence is golden"
60
61 # success, all done
62 status=0
63 exit