2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
7 # Check if ctime is updated and written to disk after setfacl
9 # Regression test for the following extN commits
10 # c6ac12a ext4: update ctime when changing the file's permission by setfacl
11 # 30e2bab ext3: update ctime when changing the file's permission by setfacl
12 # 523825b ext2: update ctime when changing the file's permission by setfacl
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
34 testfile=$SCRATCH_MNT/testfile.$seq
36 # real QA test starts here
42 echo "Silence is golden"
44 _scratch_mkfs >/dev/null 2>&1
45 _scratch_mount >/dev/null 2>&1
49 ctime1=`stat -c %Z $testfile`
52 setfacl -m 'u::x,g::x,o::x' $testfile
53 ctime2=`stat -c %Z $testfile`
56 ctime3=`stat -c %Z $testfile`
58 if [ "$ctime1" == "$ctime2" ]; then
59 echo "error: ctime not updated after setfacl"
60 elif [ "$ctime1" == "$ctime3" ]; then
61 echo "error: on disk ctime not updated"