xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / overlay / 003
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 003
6 #
7 # Test overlayfs basic whiteout.
8 #
9 # Overlayfs whiteout can be visible if underlying upper fs does not
10 # support d_type. Kernel commit
11 #       45aebea (ovl: Ensure upper filesystem supports d_type)
12 # prevents mounting overlayfs like this since v4.6-rc1.
13 # No harm to keep this test as a sanity check.
14 #
15 seq=`basename $0`
16 seqres=$RESULT_DIR/$seq
17 echo "QA output created by $seq"
18
19 here=`pwd`
20 tmp=/tmp/$$
21 status=1        # failure is the default!
22 trap "_cleanup; exit \$status" 0 1 2 3 15
23
24 _cleanup()
25 {
26         cd /
27         rm -f $tmp.*
28 }
29
30 # get standard environment, filters and checks
31 . ./common/rc
32 . ./common/filter
33
34 # remove previous $seqres.full before test
35 rm -f $seqres.full
36
37 # real QA test starts here
38
39 # Modify as appropriate.
40 _supported_fs overlay
41 _supported_os Linux
42 _require_scratch
43
44 # Remove all files from previous tests
45 _scratch_mkfs
46
47 # Create test files dirs in lower dir
48 lowerdir=${OVL_BASE_SCRATCH_MNT}/${OVL_LOWER}
49 mkdir -p $lowerdir
50
51 touch ${lowerdir}/test_file
52 ln -s ${lowerdir}/test_file ${lowerdir}/test_softlink_file
53 ln ${lowerdir}/test_file ${lowerdir}/test_hardlink_file
54
55 mkdir -p ${lowerdir}/test_dir
56 ln -s ${lowerdir}/test_dir ${lowerdir}/test_softlink_dir
57
58 mknod ${lowerdir}/test_cdev c 2 3
59 ln -s ${lowerdir}/test_cdev ${lowerdir}/test_softlink_cdev
60 ln ${lowerdir}/test_cdev ${lowerdir}/test_hardlink_cdev
61
62 mknod ${lowerdir}/test_bdev b 2 4
63 ln -s ${lowerdir}/test_bdev ${lowerdir}/test_softlink_bdev
64 ln ${lowerdir}/test_bdev ${lowerdir}/test_hardlink_bdev
65
66 mknod ${lowerdir}/test_pipe p
67 ln -s ${lowerdir}/test_pipe ${lowerdir}/test_softlink_pipe
68 ln ${lowerdir}/test_pipe ${lowerdir}/test_hardlink_pipe
69
70 _scratch_mount
71
72 # whiteout all files in overlay mountpoint
73 rm -rf ${SCRATCH_MNT}/*
74 # nothing should be listed
75 ls ${SCRATCH_MNT}/
76
77 # unmount overlayfs but not base fs
78 $UMOUNT_PROG $SCRATCH_MNT
79
80 echo "Silence is golden"
81 # success, all done
82 status=0
83 exit