2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 Fujitsu. All Rights Reserved.
7 # Check if ctime update caused by chattr is written to disk
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
13 status=1 # failure is the default!
17 rm -f $SCRATCH_MNT/tmp*
20 trap "_cleanup ; exit \$status" 0 1 2 3 15
22 # get standard environment, filters and checks
27 # real QA test starts here
32 _scratch_mkfs > /dev/null 2>&1
35 touch $SCRATCH_MNT/tmp
37 ctime1=`stat -c %z $SCRATCH_MNT/tmp`
40 $CHATTR_PROG +A $SCRATCH_MNT/tmp
41 $CHATTR_PROG -A $SCRATCH_MNT/tmp
42 ctime2=`stat -c %z $SCRATCH_MNT/tmp`
45 ctime3=`stat -c %z $SCRATCH_MNT/tmp`
47 if [ "$ctime1" == "$ctime2" ]; then
48 echo "error: ctime not updated after chattr"
49 elif [ "$ctime1" == "$ctime3" ]; then
50 echo "error: on disk ctime not updated"