Adds a new fstest invocation test (074).
[xfstests-dev.git] / 011
1 #! /bin/sh
2 # XFS QA Test No. 011
3 #
4 # dirstress
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
8
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of version 2 of the GNU General Public License as
11 # published by the Free Software Foundation.
12
13 # This program is distributed in the hope that it would be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17 # Further, this software is distributed without any warranty that it is
18 # free of the rightful claim of any third person regarding infringement
19 # or the like.  Any license provided herein, whether implied or
20 # otherwise, applies only to this software file.  Patent licenses, if
21 # any, provided herein do not apply to combinations of this program with
22 # other software, or any other product whatsoever.
23
24 # You should have received a copy of the GNU General Public License along
25 # with this program; if not, write the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
27
28 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
29 # Mountain View, CA  94043, or:
30
31 # http://www.sgi.com 
32
33 # For further information regarding this notice, see: 
34
35 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
36 #-----------------------------------------------------------------------
37 #
38 # creator
39 owner=dxm@sgi.com
40
41 seq=`basename $0`
42 echo "QA output created by $seq"
43
44 # get standard environment, filters and checks
45 . ./common.rc
46 . ./common.filter
47
48 here=`pwd`
49 tmp=/tmp/$$
50 status=0        # success is the default!
51 out=$TEST_DIR/dirstress.$$
52 trap "rm -f $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
53
54 _cleanup()
55 {
56     rm -rf $out
57 }
58
59 # get standard environment, filters and checks
60 . ./common.rc
61 . ./common.filter
62
63 count=1000
64 if ! mkdir $out
65 then
66     echo "!! couldn't mkdir $out"
67     status=1
68     exit
69 fi
70
71 rm -f $seq.out.full
72
73 _test()
74 {
75     test="$1"
76     args="$2"
77     count="$3"
78     
79     echo "*** TEST $test $args -f <count>"
80     if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1
81     then
82         echo "    dirstress failed"
83         echo "*** TEST $test -d $out -f $count $args" >>$seq.out.full
84         cat $tmp.out >>$seq.out.full
85         status=1
86     fi
87 }
88
89 # dirstress doesn't check returns - this is a crash & burn test.
90
91 count=1000
92 _test 1 "-p 1 -n 1" $count
93 _test 2 "-p 5 -n 1" $count
94 _test 3 "-p 5 -n 5" $count
95
96 # if error
97 exit