generic/402: Drop useless fail message
[xfstests-dev.git] / tests / generic / 013
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 013
6 #
7 # fsstress
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=0        # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     # we might get here with a RO FS
22     _test_cycle_mount
23     # now remove fsstress directory.
24     rm -rf $TEST_DIR/fsstress.$$.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 _do_test()
32 {
33     _n="$1"
34     _param="$2"
35     _count="$3"
36
37     out=$TEST_DIR/fsstress.$$.$_n
38     rm -rf $out
39     if ! mkdir $out
40     then
41         echo "    failed to mkdir $out"
42         status=1
43         exit
44     fi
45
46     echo ""
47     echo "-----------------------------------------------"
48     echo "fsstress.$_n : $_param"
49     echo "-----------------------------------------------"
50     # -m limits number of users/groups so check doesn't fail (malloc) later
51     dbgoutfile=$seqres.full
52     if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1
53     then
54         echo "    fsstress (count=$_count) returned $? - see $seqres.full"
55         echo "--------------------------------------"       >>$seqres.full
56         echo "$_n - output from fsstress:"                  >>$seqres.full
57         echo "--------------------------------------"       >>$seqres.full
58         echo "<NOT LOGGED>"                                 >>$seqres.full
59         #cat $tmp.out                                       >>$seqres.full
60         status=1
61     fi
62
63     _check_test_fs
64 }
65
66 # real QA test starts here
67 _supported_fs generic
68 _require_test
69
70 rm -f $seqres.full
71 echo "brevity is wit..."
72
73 count=1000
74 procs=20
75
76 _check_test_fs
77
78 # the default
79
80 _do_test 1 "-r" $count
81
82 # and the default with multiprocess
83
84 _do_test 2 "-p $procs -r" $count
85
86 # from Glen's notes
87
88 _do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count
89
90 # if all ok by here then probably don't need $seqres.full
91 rm -f $seqres.full
92
93 exit
94
95 # Test with error injection:
96 #
97 # (error injection)
98 # fsstress -n 1000 -d $scratch -p 4 -z -f rmdir=10 -f link=10 -f creat=10 \
99 #          -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 \
100 #          -e 1
101 #
102 # Error values 1 - 6 test IFLUSH
103 #         1 - corrupt buffer being flushed to di_core.di_magic
104 #         2 - corrupt inode being flushed i_d.di_magic
105 #         3 - corrupt S_IFREG format check
106 #         4 - corrupt S_IFDIR format check
107 #         5 - corrupt i_d.di_nextents
108 #         6 - corrupt i_d.di_forkoff > sb_inodesize