4 # Check if ctime is updated and written to disk after setfacl
6 # Regression test for the following extN commits
7 # c6ac12a ext4: update ctime when changing the file's permission by setfacl
8 # 30e2bab ext3: update ctime when changing the file's permission by setfacl
9 # 523825b ext2: update ctime when changing the file's permission by setfacl
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
35 status=1 # failure is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
44 # get standard environment, filters and checks
48 testfile=$SCRATCH_MNT/testfile.$seq
50 # real QA test starts here
55 echo "Silence is golden"
57 _scratch_mkfs >/dev/null 2>&1
58 _scratch_mount >/dev/null 2>&1
62 ctime1=`stat -c %Z $testfile`
65 setfacl -m 'u::x,g::x,o::x' $testfile
66 ctime2=`stat -c %Z $testfile`
69 ctime3=`stat -c %Z $testfile`
71 if [ "$ctime1" == "$ctime2" ]; then
72 echo "error: ctime not updated after setfacl"
73 elif [ "$ctime1" == "$ctime3" ]; then
74 echo "error: on disk ctime not updated"