xfstests: randholes: use posix_memalign()
[xfstests-dev.git] / 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 # creator
30 owner=hch@lst.de
31
32 seq=`basename $0`
33 echo "QA output created by $seq"
34
35 here=`pwd`
36 tmp=/tmp/$$
37 status=1        # failure is the default!
38
39 _cleanup()
40 {
41         rm -rf $TEST_DIR/ttt
42 }
43 trap "_cleanup; exit \$status" 0 1 2 3 15
44
45 # get standard environment, filters and checks
46 . ./common.rc
47 . ./common.filter
48
49 # real QA test starts here
50 _supported_fs xfs
51 _supported_os Linux
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 $seq.full
67 status=0