Some experimentation for pv#962014 doing prealloc, direct write, buffered read etc...
[xfstests-dev.git] / 011
1 #! /bin/sh
2 # FS QA Test No. 011
3 #
4 # dirstress
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=dxm@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 out=""
17 here=`pwd`
18 tmp=/tmp/$$
19 status=0        # success is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24     cd /
25     rm -f $tmp.*
26     [ -n "$out" ] && rm -rf $out
27     _cleanup_testdir
28 }
29
30 # get standard environment, filters and checks
31 . ./common.rc
32 . ./common.filter
33
34 # real QA test starts here
35 _supported_fs xfs udf nfs
36 _supported_os IRIX Linux
37
38 _setup_testdir
39
40 out=$testdir/dirstress.$$
41
42 rm -f $seq.full
43
44 _test()
45 {
46     test="$1"
47     args="$2"
48     count="$3"
49     
50     echo "*** TEST $test $args -f <count>"
51     if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1
52     then
53         echo "    dirstress failed"
54         echo "*** TEST $test -d $out -f $count $args" >>$seq.full
55         cat $tmp.out >>$seq.full
56         status=1
57     fi
58 }
59
60 # dirstress doesn't check returns - this is a crash & burn test.
61 if ! mkdir $out
62 then
63     echo "!! couldn't mkdir $out"
64     status=1
65     exit
66 fi
67
68 count=1000
69 _test 1 "-p 1 -n 1" $count
70 _test 2 "-p 5 -n 1" $count
71 _test 3 "-p 5 -n 5" $count
72
73 # if error
74 exit