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 with FSTYP=overlay on kernel < v5.10
12 # because prior to commit 61536bed2149 ("ovl: support [S|G]ETFLAGS
13 # and FS[S|G]ETXATTR ioctls for directories"), t_immutable -c would
14 # fail to prepare immutable/append-only directories on the overlay
18 seqres=$RESULT_DIR/$seq
19 echo "QA output created by $seq"
22 timmutable=$here/src/t_immutable
23 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
25 status=1 # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
30 $timmutable -r $upperdir/t_immutable &> /dev/null
34 # get standard environment, filters and checks
41 _require_test_program "t_immutable"
46 # Preparing immutable files in uppper dir
48 $timmutable -C $upperdir/t_immutable >$tmp.out 2>&1
49 if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then
50 _notrun "Setting immutable/append flag not supported"
55 # Test immutability of files in overlay
56 $timmutable $SCRATCH_MNT/t_immutable 2>&1