xfstests: kill useless test owner fields
[xfstests-dev.git] / 236
1 #! /bin/bash
2 # FS QA Test No. 236
3 #
4 # Check ctime updated or not if file linked
5 # See also http://marc.info/?l=linux-btrfs&m=127434439020230&w=2
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2010 FUJITSU LIMITED. All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 echo "QA output created by $seq"
28
29 _cleanup()
30 {
31         rm -f $TEST_DIR/ouch*
32 }
33
34 here=`pwd`
35 status=1        # failure is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
37
38 # get standard environment, filters and checks
39 . ./common.rc
40
41 # real QA test starts here
42 _supported_fs generic
43 # only Linux supports fallocate
44 _supported_os Linux
45
46 rm -f $TEST_DIR/ouch*
47
48 # create a file and get its ctime
49 touch $TEST_DIR/ouch
50 ctime=`stat -c %Z $TEST_DIR/ouch`
51 sleep 1
52
53 # create a link to a file and get existing file's ctime
54 link $TEST_DIR/ouch $TEST_DIR/ouch2
55 ctime2=`stat -c %Z $TEST_DIR/ouch`
56
57 # check ctime updated
58 if [ $ctime2 -le $ctime ]; then
59         echo "ctime: $ctime -> $ctime2 "
60         echo "Fatal error: ctime not updated after link"
61         _cleanup
62         exit 1
63 fi
64
65 echo "Test over."
66 # success, all done
67 status=0
68 exit