4 # check out-of-space behaviour
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
31 status=1 # success is the default!
33 # get standard environment, filters and checks
42 trap "_cleanup; exit \$status" 0 1 2 3 15
46 _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
49 # real QA test starts here
54 _require_no_large_scratch_dev
56 # With filesystems less than 100mb btrfs is created in mixed mode
57 # which can lead to slight accounting errors of 1mb. Having the
58 # fs be at least 101 mb ensures those errors are within the error
60 _scratch_mkfs_sized `expr 101 \* 1024 \* 1024` >/dev/null 2>&1 \
61 || _fail "mkfs failed"
63 out=$SCRATCH_MNT/fillup.$$
69 echo " *** failed to get free space (0)"
72 echo "free space at start $free0" >> $seqres.full
74 echo "fill disk:" # well, filesystem really - not disk
76 POSIXLY_CORRECT=yes dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd
78 echo "check free space:"
83 echo " *** failed to get free space (1)"
86 echo "free space after fill $free1" >> $seqres.full
90 echo " *** file not created"
96 echo " *** file created with zero length"
105 echo " *** file not deleted"
111 echo " *** file still exists"
116 echo "check free space:"
123 echo " *** failed to get free space (2)"
126 echo "free space after delete $free2" >> $seqres.full
129 _within_tolerance "free space" $free2 $free0 1% -v