xfs: fix old fuzz test invocations of xfs_repair
[xfstests-dev.git] / tests / generic / 011
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 011
6 #
7 # dirstress
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 out=""
14 here=`pwd`
15 tmp=/tmp/$$
16 status=0        # success is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21     cd /
22     rm -f $tmp.*
23     [ -n "$out" ] && rm -rf $out
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # real QA test starts here
31 _supported_fs generic
32 _require_test
33
34 out=$TEST_DIR/dirstress.$$
35
36 rm -f $seqres.full
37
38 _test()
39 {
40     test="$1"
41     args="$2"
42     count="$3"
43     
44     echo "*** TEST $test $args -f <count>"
45     if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1
46     then
47         echo "    dirstress failed"
48         echo "*** TEST $test -d $out -f $count $args" >>$seqres.full
49         cat $tmp.out >>$seqres.full
50         status=1
51     fi
52 }
53
54 # dirstress doesn't check returns - this is a crash & burn test.
55 if ! mkdir $out
56 then
57     echo "!! couldn't mkdir $out"
58     status=1
59     exit
60 fi
61
62 count=1000
63 _test 1 "-p 1 -n 1" $count
64 _test 2 "-p 5 -n 1" $count
65 _test 3 "-p 5 -n 5" $count
66
67 # if error
68 exit