4 # Test overlayfs basic whiteout.
6 # Overlayfs whiteout can be visible if underlying upper fs does not
7 # support d_type. Kernel commit
8 # 45aebea (ovl: Ensure upper filesystem supports d_type)
9 # prevents mounting overlayfs like this since v4.6-rc1.
10 # No harm to keep this test as a sanity check.
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
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.
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.
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 #-----------------------------------------------------------------------
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
36 status=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
45 # get standard environment, filters and checks
49 # remove previous $seqres.full before test
52 # real QA test starts here
54 # Modify as appropriate.
59 # Remove all files from previous tests
62 # Create test files dirs in lower dir
63 lowerdir=${OVL_BASE_SCRATCH_MNT}/${OVL_LOWER}
66 touch ${lowerdir}/test_file
67 ln -s ${lowerdir}/test_file ${lowerdir}/test_softlink_file
68 ln ${lowerdir}/test_file ${lowerdir}/test_hardlink_file
70 mkdir -p ${lowerdir}/test_dir
71 ln -s ${lowerdir}/test_dir ${lowerdir}/test_softlink_dir
73 mknod ${lowerdir}/test_cdev c 2 3
74 ln -s ${lowerdir}/test_cdev ${lowerdir}/test_softlink_cdev
75 ln ${lowerdir}/test_cdev ${lowerdir}/test_hardlink_cdev
77 mknod ${lowerdir}/test_bdev b 2 4
78 ln -s ${lowerdir}/test_bdev ${lowerdir}/test_softlink_bdev
79 ln ${lowerdir}/test_bdev ${lowerdir}/test_hardlink_bdev
81 mknod ${lowerdir}/test_pipe p
82 ln -s ${lowerdir}/test_pipe ${lowerdir}/test_softlink_pipe
83 ln ${lowerdir}/test_pipe ${lowerdir}/test_hardlink_pipe
87 # whiteout all files in overlay mountpoint
88 rm -rf ${SCRATCH_MNT}/*
89 # nothing should be listed
92 # unmount overlayfs but not base fs
93 $UMOUNT_PROG $SCRATCH_MNT
96 echo "Silence is golden"