4 # Run the t_immutable test program for immutable/append-only files
5 # and directories in an overlayfs upper directory.
7 # This test is similar and was derived from generic/079, but
8 # the original test is _notrun on overlay mount because FS_IOC_GETFLAGS
9 # FS_IOC_SETFLAGS ioctls fail on overlay directory inodes.
11 #-----------------------------------------------------------------------
12 # Copyright (C) 2017 CTERA Networks. All Rights Reserved.
13 # Author: Amir Goldstein <amir73il@gmail.com>
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
28 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
36 timmutable=$here/src/t_immutable
37 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
44 $timmutable -r $upperdir/t_immutable &> /dev/null
48 # get standard environment, filters and checks
56 _require_test_program "t_immutable"
61 # Preparing immutable files in uppper dir
63 $timmutable -C $upperdir/t_immutable >$tmp.out 2>&1
64 if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then
65 _notrun "Setting immutable/append flag not supported"
70 # Test immutability of files in overlay
71 $timmutable $SCRATCH_MNT/t_immutable 2>&1