xfstests: convert tests to use new results directory
[xfstests-dev.git] / tests / generic / 083
1 #! /bin/bash
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 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
17 #
18 # This program is free software; you can redistribute it and/or
19 # modify it under the terms of the GNU General Public License as
20 # published by the Free Software Foundation.
21 #
22 # This program is distributed in the hope that it would be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 # GNU General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write the Free Software Foundation,
29 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
30 #
31 #-----------------------------------------------------------------------
32 #
33
34
35 seq=`basename $0`
36 seqres=$RESULT_DIR/$seq
37 seqres=$RESULT_DIR/$seq
38 seqres=$RESULT_DIR/$seq
39 echo "QA output created by $seq"
40
41 here=`pwd`
42 tmp=/tmp/$$
43 status=1
44
45 _cleanup()
46 {
47         echo "*** unmount"
48         umount $SCRATCH_MNT 2>/dev/null
49         rm -f $tmp.*
50 }
51 trap "_cleanup; exit \$status" 0 1 2 3 15
52
53 # get standard environment, filters and checks
54 . ./common.rc
55 . ./common.filter
56
57 # real QA test starts here
58 _supported_fs generic
59 _supported_os IRIX Linux
60
61 _require_scratch
62 _require_no_large_scratch_dev
63
64 rm -f $seqres.full
65
66 workout()
67 {
68         fsz=$1
69         ags=$2
70         procs=$3
71         nops=$4
72
73         umount $SCRATCH_DEV >/dev/null 2>&1
74         echo "*** mkfs -dsize=$fsz,agcount=$ags"    >>$seqres.full
75         echo ""                                     >>$seqres.full
76         if [ $FSTYP = xfs ]
77         then
78                 _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags  >>$seqres.full 2>&1 \
79                         || _fail "size=$fsz,agcount=$ags mkfs failed"
80         else
81                 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
82                         || _fail "size=$fsz mkfs failed"
83         fi
84         _scratch_mount                              >>$seqres.full 2>&1 \
85                 || _fail "mount failed"
86
87         # -w ensures that the only ops are ones which cause write I/O
88         FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
89         $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
90         _check_scratch_fs
91 }
92
93 echo "*** test out-of-space handling for random write operations"
94
95 filesize=`expr 100 \* 1024 \* 1024`
96 agcount=6
97 numprocs=15
98 numops=1500
99
100 workout $filesize $agcount $numprocs $numops
101
102 echo "*** done"
103 status=0
104 exit