lib/: spdx license conversion
[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 _supported_os Linux
33 _require_test
34
35 out=$TEST_DIR/dirstress.$$
36
37 rm -f $seqres.full
38
39 _test()
40 {
41     test="$1"
42     args="$2"
43     count="$3"
44     
45     echo "*** TEST $test $args -f <count>"
46     if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1
47     then
48         echo "    dirstress failed"
49         echo "*** TEST $test -d $out -f $count $args" >>$seqres.full
50         cat $tmp.out >>$seqres.full
51         status=1
52     fi
53 }
54
55 # dirstress doesn't check returns - this is a crash & burn test.
56 if ! mkdir $out
57 then
58     echo "!! couldn't mkdir $out"
59     status=1
60     exit
61 fi
62
63 count=1000
64 _test 1 "-p 1 -n 1" $count
65 _test 2 "-p 5 -n 1" $count
66 _test 3 "-p 5 -n 5" $count
67
68 # if error
69 exit