30f6c46873a3c4a26bf2dedd5cea12623c8dcb24
[xfstests-dev.git] / 083
1 #! /bin/sh
2 # XFS 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 #-----------------------------------------------------------------------
11 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
12
13 # This program is free software; you can redistribute it and/or modify it
14 # under the terms of version 2 of the GNU General Public License as
15 # published by the Free Software Foundation.
16
17 # This program is distributed in the hope that it would be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21 # Further, this software is distributed without any warranty that it is
22 # free of the rightful claim of any third person regarding infringement
23 # or the like.  Any license provided herein, whether implied or
24 # otherwise, applies only to this software file.  Patent licenses, if
25 # any, provided herein do not apply to combinations of this program with
26 # other software, or any other product whatsoever.
27
28 # You should have received a copy of the GNU General Public License along
29 # with this program; if not, write the Free Software Foundation, Inc., 59
30 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
31
32 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
33 # Mountain View, CA  94043, or:
34
35 # http://www.sgi.com 
36
37 # For further information regarding this notice, see: 
38
39 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
40 #-----------------------------------------------------------------------
41 #
42 # creator
43 owner=nathans@sgi.com
44
45 seq=`basename $0`
46 echo "QA output created by $seq"
47
48 here=`pwd`
49 tmp=/tmp/$$
50 status=1
51
52 _cleanup()
53 {
54         echo "*** unmount"
55         umount $SCRATCH_MNT 2>/dev/null
56 }
57 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
58
59 # get standard environment, filters and checks
60 . ./common.rc
61 . ./common.filter
62
63 # real QA test starts here
64 _require_scratch
65 _require_nobigloopfs
66
67 echo "*** init fs"
68
69 rm -f $seq.full
70 umount $SCRATCH_DEV >/dev/null 2>&1
71 echo "*** MKFS ***"                         >>$seq.full
72 echo ""                                     >>$seq.full
73 _scratch_mkfs_xfs -dsize=50m                >>$seq.full 2>&1 \
74         || _fail "50m mkfs failed"
75 _scratch_mount                              >>$seq.full 2>&1 \
76         || _fail "mount failed"
77
78 echo "*** test out-of-space handling for random write operations"
79
80 ltp/fsstress -d $SCRATCH_MNT -w -p 10 -n 10000 $FSSTRESS_AVOID >>$seq.full
81 _check_scratch_fs
82
83 echo "*** done"
84 status=0
85 exit