2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2017 CTERA Networks. All Rights Reserved.
7 # Run the t_immutable test program for immutable/append-only files
8 # and directories in an overlayfs upper directory.
10 # This test is similar and was derived from generic/079, but
11 # the original test is _notrun on overlay mount because FS_IOC_GETFLAGS
12 # FS_IOC_SETFLAGS ioctls fail on overlay directory inodes.
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
19 timmutable=$here/src/t_immutable
20 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
22 status=1 # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
27 $timmutable -r $upperdir/t_immutable &> /dev/null
31 # get standard environment, filters and checks
39 _require_test_program "t_immutable"
44 # Preparing immutable files in uppper dir
46 $timmutable -C $upperdir/t_immutable >$tmp.out 2>&1
47 if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then
48 _notrun "Setting immutable/append flag not supported"
53 # Test immutability of files in overlay
54 $timmutable $SCRATCH_MNT/t_immutable 2>&1