fsx: Replace use of bzero() with memset()
[xfstests-dev.git] / 188
1 #! /bin/sh
2 # FS QA Test No. 188
3 #
4 # drive the src/nametest program for CI mode
5 # which does a heap of open(create)/unlink/stat
6 # and checks that error codes make sense with its
7 # memory of the files created.
8 #
9 # All filenames generated map to the same hash
10 # value in XFS stressing leaf block traversal in
11 # node form directories as well.
12 #
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
15 #-----------------------------------------------------------------------
16 #
17 # creator
18 owner=bnaujok@sgi.com
19
20 seq=`basename $0`
21 echo "QA output created by $seq"
22
23 here=`pwd`
24 tmp=/tmp/$$
25 status=0        # success is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
27
28 _cleanup()
29 {
30     cd /
31     rm -f $tmp.*
32     rm -rf $SCRATCH_MNT/$seq
33 }
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38
39 # real QA test starts here
40 _supported_fs xfs
41 _supported_os IRIX Linux
42
43 if [ $XFSPROGS_VERSION -lt 21000 ]; then
44     _notrun "this test requires case-insensitive support"
45 fi
46
47 _require_scratch
48 rm -f $seq.full
49
50 _scratch_mkfs -n version=ci >/dev/null 2>&1
51 _scratch_mount
52
53 status=1 # default failure
54 sourcefile=$tmp.ci_nametest
55 seed=1
56
57 # need to create an input file with a list of filenames on each line
58 # do number of files for testing to try each directory format
59
60 # start with small number of files and increase by 4x for each run
61 max_files=6144
62 num_files=6
63
64 mkdir $SCRATCH_MNT/$seq
65 while [ $num_files -le $max_files ]; do
66   iterations=`expr $num_files \* 10`
67   $here/src/genhashnames $SCRATCH_MNT/$seq/$num_files $num_files $seed >>$sourcefile
68   mkdir $SCRATCH_MNT/$seq/$num_files
69   $here/src/nametest -l $sourcefile -s $seed -i $iterations -z -c
70   num_files=`expr $num_files \* 4`
71 done
72
73 # success, all done
74 status=0
75 exit