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