xfstests: randholes: rearrange fns and drop their declarations
[xfstests-dev.git] / 117
1 #! /bin/bash
2 # FS QA Test No. 117
3 #
4 # Attempt to cause filesystem corruption with serial fsstresses doing
5 # extended attributes writes - pv 940655
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25 # creator
26 owner=ajones@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 # seed for fsstress known to cause curruptions
37 seed=1122413794
38
39 ITERATIONS=10
40
41 _cleanup()
42 {
43     cd /
44     rm -f $tmp.*
45     _cleanup_testdir
46 }
47
48 # get standard environment, filters and checks
49 . ./common.rc
50 . ./common.filter
51
52 # real QA test starts here
53 _supported_fs xfs
54 _supported_os IRIX Linux
55
56 _setup_testdir
57 _require_scratch
58
59 rm -f $seq.full
60 umount $SCRATCH_DEV >/dev/null 2>&1
61 echo "*** MKFS ***"                         >>$seq.full
62 echo ""                                     >>$seq.full
63 _scratch_mkfs_xfs                           >>$seq.full 2>&1 \
64     || _fail "mkfs failed"
65 _scratch_mount                              >>$seq.full 2>&1 \
66     || _fail "mount failed"
67
68 mkdir -p $SCRATCH_MNT/fsstress
69
70 echo
71 echo Running fsstress in serial:
72 i=0
73 while [ $i -lt $ITERATIONS ]; do
74     echo fsstress iteration: $i | tee -a $seq.full
75     $FSSTRESS_PROG \
76         -d $SCRATCH_MNT/fsstress \
77         -f allocsp=0 \
78         -f freesp=0 \
79         -f bulkstat=0 \
80         -f bulkstat1=0 \
81         -f resvsp=0 \
82         -f unresvsp=0 \
83         -f attr_set=100 \
84         -f attr_remove=100 \
85         -s $seed \
86         -S -p 1 -n 1000 >>$seq.full 2>&1
87
88     let i=$i+1
89 done
90
91 cd /
92 umount $SCRATCH_MNT
93 echo 
94 echo Checking filesystem
95 _check_scratch_fs
96 _scratch_mount
97
98 status=$?
99 exit