overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / overlay / 009
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 009
6 #
7 # dentry leak for default_permissions mount option
8 #
9 # This is fixed by kernel commit named as
10 # ovl: fix dentry leak for default_permissions
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 rm -f $seqres.full
32
33 # real QA test starts here
34 _supported_fs overlay
35 _supported_os Linux
36 _require_scratch
37
38 # Remove all files from previous tests
39 _scratch_mkfs
40
41 # Create test file in lowerdir
42 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
43 mkdir -p $lowerdir
44 touch $lowerdir/testfile
45
46 # mount overlay with default_permissions option, get a reference on the dentry
47 _scratch_mount -o default_permissions
48 cat $SCRATCH_MNT/testfile
49
50 # overlay will be unmounted by test harness and kernel BUG if dentry leaked
51 echo "Silence is golden"
52 status=0
53 exit