2a205289ccfb48081f283cc504a4e69479f4351f
[xfstests-dev.git] / tests / xfs / 197
1 #! /bin/bash
2 # FS QA Test No. 197
3 #
4 # Check that d_off can be represented in a 32 bit long type without
5 # truncation.  Note that this test will always succeed on a 64 bit
6 # systems where there is no smaller off_t.
7 #
8 # Based on a testcase from John Stanley <jpsinthemix@verizon.net>.
9 #
10 # http://oss.sgi.com/bugzilla/show_bug.cgi?id=808
11 #
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2008 Christoph Hellwig.
14 #
15 # This program is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation.
18 #
19 # This program is distributed in the hope that it would be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write the Free Software Foundation,
26 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
27 #-----------------------------------------------------------------------
28 #
29
30 seq=`basename $0`
31 seqres=$RESULT_DIR/$seq
32 seqres=$RESULT_DIR/$seq
33 seqres=$RESULT_DIR/$seq
34 echo "QA output created by $seq"
35
36 here=`pwd`
37 tmp=/tmp/$$
38 status=1        # failure is the default!
39
40 _cleanup()
41 {
42         rm -rf $TEST_DIR/ttt
43 }
44 trap "_cleanup; exit \$status" 0 1 2 3 15
45
46 # get standard environment, filters and checks
47 . ./common/rc
48 . ./common/filter
49
50 # real QA test starts here
51 _supported_fs xfs
52 _supported_os Linux
53
54 bitsperlong=`src/feature -w`
55 if [ "$bitsperlong" -ne 32 ]; then
56         _notrun "This test is only valid on 32 bit machines"
57 fi
58
59 mkdir $TEST_DIR/ttt
60 for n in {1..168}; do
61     touch $TEST_DIR/ttt/$n;
62 done
63 src/t_dir_offset $TEST_DIR/ttt
64
65 # success, all done
66 echo "*** done"
67 rm -f $seqres.full
68 status=0