xfs: fix more xfs_db open-coding instances
[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 echo "QA output created by $seq"
33
34 here=`pwd`
35 tmp=/tmp/$$
36 status=1        # failure is the default!
37
38 _cleanup()
39 {
40         rm -rf $TEST_DIR/ttt
41 }
42 trap "_cleanup; exit \$status" 0 1 2 3 15
43
44 # get standard environment, filters and checks
45 . ./common/rc
46 . ./common/filter
47
48 # real QA test starts here
49 _supported_fs xfs
50 _supported_os Linux
51 _require_test
52
53 bitsperlong=`src/feature -w`
54 if [ "$bitsperlong" -ne 32 ]; then
55         _notrun "This test is only valid on 32 bit machines"
56 fi
57
58 mkdir $TEST_DIR/ttt
59 for n in {1..168}; do
60     touch $TEST_DIR/ttt/$n;
61 done
62 src/t_dir_offset $TEST_DIR/ttt
63
64 # success, all done
65 echo "*** done"
66 rm -f $seqres.full
67 status=0