Fixed double function issue with the UDF merge.
[xfstests-dev.git] / 083
1 #! /bin/sh
2 # FS QA Test No. 083
3 #
4 # Exercise filesystem full behaviour - run numerous fsstress
5 # processes in write mode on a small filesystem.  NB: delayed
6 # allocate flushing is quite deadlock prone at the filesystem
7 # full boundary due to the fact that we will retry allocation
8 # several times after flushing, before giving back ENOSPC.
9 #
10 # Note that this test will intentionally cause console msgs of form:
11 #     dksc0d1s4: Process [fsstress] ran out of disk space
12 #     dksc0d1s4: Process [fsstress] ran out of disk space
13 #     dksc0d1s4: Process [fsstress] ran out of disk space
14 #
15
16 #-----------------------------------------------------------------------
17 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
18
19 # This program is free software; you can redistribute it and/or modify it
20 # under the terms of version 2 of the GNU General Public License as
21 # published by the Free Software Foundation.
22
23 # This program is distributed in the hope that it would be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26
27 # Further, this software is distributed without any warranty that it is
28 # free of the rightful claim of any third person regarding infringement
29 # or the like.  Any license provided herein, whether implied or
30 # otherwise, applies only to this software file.  Patent licenses, if
31 # any, provided herein do not apply to combinations of this program with
32 # other software, or any other product whatsoever.
33
34 # You should have received a copy of the GNU General Public License along
35 # with this program; if not, write the Free Software Foundation, Inc., 59
36 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
37
38 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
39 # Mountain View, CA  94043, or:
40
41 # http://www.sgi.com 
42
43 # For further information regarding this notice, see: 
44
45 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
46 #-----------------------------------------------------------------------
47 #
48 # creator
49 owner=nathans@sgi.com
50
51 seq=`basename $0`
52 echo "QA output created by $seq"
53
54 here=`pwd`
55 tmp=/tmp/$$
56 status=1
57
58 _cleanup()
59 {
60         echo "*** unmount"
61         umount $SCRATCH_MNT 2>/dev/null
62         rm -f $tmp.*
63 }
64 trap "_cleanup; exit \$status" 0 1 2 3 15
65
66 # get standard environment, filters and checks
67 . ./common.rc
68 . ./common.filter
69
70 # real QA test starts here
71 _supported_fs xfs
72 _supported_os IRIX Linux
73
74 _require_scratch
75 _require_nobigloopfs
76
77 rm -f $seq.full
78
79 workout()
80 {
81         fsz=$1
82         ags=$2
83         procs=$3
84         nops=$4
85
86         umount $SCRATCH_DEV >/dev/null 2>&1
87         echo "*** mkfs -dsize=$fsz,agcount=$ags"    >>$seq.full
88         echo ""                                     >>$seq.full
89         _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags  >>$seq.full 2>&1 \
90                 || _fail "size=$fsz,agcount=$ags mkfs failed"
91         _scratch_mount                              >>$seq.full 2>&1 \
92                 || _fail "mount failed"
93
94         # -w ensures that the only ops are ones which cause write I/O
95         ltp/fsstress -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID \
96                 >>$seq.full
97         _check_scratch_fs
98 }
99
100 echo "*** test out-of-space handling for random write operations"
101
102 filesize=100m
103 agcount=6
104 numprocs=15
105 numops=1500
106
107 workout $filesize $agcount $numprocs $numops
108
109 echo "*** done"
110 status=0
111 exit