Update copyright annotations and license boilerplates to correspond with SGI Legals...
[xfstests-dev.git] / 117
1 #! /bin/sh
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 #  This program is free software; you can redistribute it and/or modify
10 #  it under the terms of the GNU General Public License as published by
11 #  the Free Software Foundation; either version 2 of the License, or
12 #  (at your option) any later version.
13 #
14 #  This program is distributed in the hope that it will 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 to the Free Software
21 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
22 #  USA
23 #
24 #  Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
25 #  Mountain View, CA 94043, USA, or: http://www.sgi.com
26 #-----------------------------------------------------------------------
27 #
28 # creator
29 owner=ajones@sgi.com
30
31 seq=`basename $0`
32 echo "QA output created by $seq"
33
34 here=`pwd`
35 tmp=/tmp/$$
36 status=1        # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
38
39 # seed for fsstress known to cause curruptions
40 seed=1122413794
41
42 ITERATIONS=10
43
44 _cleanup()
45 {
46     cd /
47     rm -f $tmp.*
48     _cleanup_testdir
49 }
50
51 # get standard environment, filters and checks
52 . ./common.rc
53 . ./common.filter
54
55 # real QA test starts here
56 _supported_fs xfs 
57 _supported_os IRIX Linux
58
59 _setup_testdir
60 _require_scratch
61
62 rm -f $seq.full
63 umount $SCRATCH_DEV >/dev/null 2>&1
64 echo "*** MKFS ***"                         >>$seq.full
65 echo ""                                     >>$seq.full
66 _scratch_mkfs_xfs                           >>$seq.full 2>&1 \
67     || _fail "mkfs failed"
68 _scratch_mount                              >>$seq.full 2>&1 \
69     || _fail "mount failed"
70
71 mkdir -p $SCRATCH_MNT/fsstress 
72
73 echo
74 echo Running fsstress in serial:
75 i=0
76 while [ $i -lt $ITERATIONS ]; do
77     echo fsstress iteration: $i | tee -a $seq.full
78     $here/ltp/fsstress \
79         -d $SCRATCH_MNT/fsstress \
80         -f allocsp=0 \
81         -f freesp=0 \
82         -f bulkstat=0 \
83         -f bulkstat1=0 \
84         -f resvsp=0 \
85         -f unresvsp=0 \
86         -f attr_set=100 \
87         -f attr_remove=100 \
88         -s $seed \
89         -S -p 1 -n 1000 >>$seq.full 2>&1
90
91     i=`expr $i + 1`
92 done
93
94 cd /
95 umount $SCRATCH_MNT
96 echo 
97 echo Checking filesystem
98 _check_scratch_fs
99 _scratch_mount
100
101 status=$?
102 exit