2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
7 # check out-of-space behaviour
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # success is the default!
17 # get standard environment, filters and checks
26 trap "_cleanup; exit \$status" 0 1 2 3 15
30 _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
33 # real QA test starts here
38 _require_no_large_scratch_dev
40 # With filesystems less than 100mb btrfs is created in mixed mode
41 # which can lead to slight accounting errors of 1mb. Having the
42 # fs be at least 101 mb ensures those errors are within the error
44 _scratch_mkfs_sized `expr 101 \* 1024 \* 1024` >/dev/null 2>&1 \
45 || _fail "mkfs failed"
47 out=$SCRATCH_MNT/fillup.$$
53 echo " *** failed to get free space (0)"
56 echo "free space at start $free0" >> $seqres.full
58 echo "fill disk:" # well, filesystem really - not disk
60 POSIXLY_CORRECT=yes dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd
62 echo "check free space:"
67 echo " *** failed to get free space (1)"
70 echo "free space after fill $free1" >> $seqres.full
74 echo " *** file not created"
80 echo " *** file created with zero length"
89 echo " *** file not deleted"
95 echo " *** file still exists"
100 echo "check free space:"
107 echo " *** failed to get free space (2)"
110 echo "free space after delete $free2" >> $seqres.full
113 _within_tolerance "free space" $free2 $free0 1% -v