xfstests: cleanup duplicates in all tests
[xfstests-dev.git] / tests / generic / 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
26 seq=`basename $0`
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34
35 # seed and options for fsstress known to cause curruptions
36 seed=1122413794
37 fss_ops=" -z \
38     -f attr_remove=100 \
39     -f attr_set=100 \
40     -f chown=3 \
41     -f creat=4 \
42     -f dread=4 \
43     -f dwrite=4 \
44     -f fdatasync=1 \
45     -f fsync=1 \
46     -f getdents=1 \
47     -f link=1 \
48     -f mkdir=2 \
49     -f mknod=2 \
50     -f read=1 \
51     -f readlink=1 \
52     -f rename=2 \
53     -f rmdir=1 \
54     -f setxattr=1 \
55     -f stat=1 \
56     -f symlink=2 \
57     -f sync=1 \
58     -f truncate=2 \
59     -f unlink=1 \
60     -f write=4 \
61     -s $seed \
62     -m 31 -n 1000 -p 1"
63
64 ITERATIONS=10
65
66 _cleanup()
67 {
68     cd /
69     rm -f $tmp.*
70     _cleanup_testdir
71 }
72
73 # get standard environment, filters and checks
74 . ./common/rc
75 . ./common/filter
76 . ./common/attr
77
78 # real QA test starts here
79 _supported_fs generic
80 _supported_os IRIX Linux
81
82 _setup_testdir
83 _require_scratch
84 _require_attrs
85
86 rm -f $seqres.full
87 umount $SCRATCH_DEV >/dev/null 2>&1
88 echo "*** MKFS ***"                         >>$seqres.full
89 echo ""                                     >>$seqres.full
90 _scratch_mkfs                               >>$seqres.full 2>&1 \
91     || _fail "mkfs failed"
92 _scratch_mount                              >>$seqres.full 2>&1 \
93     || _fail "mount failed"
94
95 mkdir -p $SCRATCH_MNT/fsstress
96
97 echo
98 echo Running fsstress in serial:
99 i=0
100 while [ $i -lt $ITERATIONS ]; do
101     echo fsstress iteration: $i | tee -a $seqres.full
102     $FSSTRESS_PROG \
103         -d $SCRATCH_MNT/fsstress \
104         $fss_ops -S c >>$seqres.full 2>&1
105
106     let i=$i+1
107 done
108
109 cd /
110 umount $SCRATCH_MNT
111 echo 
112 echo Checking filesystem
113 _check_scratch_fs
114 _scratch_mount
115
116 status=$?
117 exit