4 # Test directory mtime and ctime are updated when moving a file onto an
5 # existing file in the directory
7 # Regression test for commit:
8 # 0b23076 ext3: fix update of mtime and ctime on rename
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
32 status=0 # success is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
38 rm -rf $TEST_DIR/testdir_$seq
39 rm -f $TEST_DIR/testfile.$seq
42 # get standard environment, filters and checks
46 # real QA test starts here
48 _supported_os IRIX Linux
51 echo "Silence is golden"
53 mkdir -p $TEST_DIR/testdir_$seq
54 touch $TEST_DIR/testdir_$seq/testfile
55 touch $TEST_DIR/testfile.$seq
57 mtime1=`stat -c %Y $TEST_DIR/testdir_$seq`
58 ctime1=`stat -c %Z $TEST_DIR/testdir_$seq`
61 mv $TEST_DIR/testfile.$seq $TEST_DIR/testdir_$seq/testfile
63 mtime2=`stat -c %Y $TEST_DIR/testdir_$seq`
64 ctime2=`stat -c %Z $TEST_DIR/testdir_$seq`
66 if [ "$mtime1" == "$mtime2" ]; then
67 echo "mtime not updated"
70 if [ "$ctime1" == "$ctime2" ]; then
71 echo "ctime not updated"