4 # Verify that mtime is not updated when deduping files.
6 #-----------------------------------------------------------------------
8 # Copyright (c) 2017 Christoph Hellwig. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #-----------------------------------------------------------------------
25 seqres=$RESULT_DIR/$seq
26 echo "QA output created by $seq"
30 trap "_cleanup; exit \$status" 0 1 2 3 15
39 # get standard environment, filters and checks
44 # real QA test starts here
51 echo "Silence is golden."
55 sourcefile=$TEST_DIR/dedup_mtime_sourcefile
56 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $sourcefile >> $seqres.full
58 destfile=$TEST_DIR/dedup_mtime_destfile
59 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $destfile >> $seqres.full
62 mtime1=`stat -c %Y $destfile`
63 ctime1=`stat -c %Z $destfile`
64 echo "before dedup: $mtime1 $ctime1" >> $seqres.full
66 # dedup to trigger timestamp change
68 _dedupe_range $sourcefile 0 $destfile 0 "4k" >> $seqres.full
70 # sample and verify that timestamps have changed.
71 mtime2=`stat -c %Y $destfile`
72 ctime2=`stat -c %Z $destfile`
73 echo "after dedup : $mtime2 $ctime2" >> $seqres.full
75 if [ "$mtime1" != "$mtime2" ]; then
79 if [ "$ctime1" != "$ctime2" ]; then