2010-01-20 10:27:08 +11:00
|
|
|
#! /bin/bash
|
2009-04-13 15:51:58 +02:00
|
|
|
# FS QA Test No. 204
|
|
|
|
|
#
|
2009-07-07 19:43:51 +02:00
|
|
|
# Test out ENOSPC flushing on small filesystems.
|
2009-04-13 15:51:58 +02:00
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Copyright (c) 2009 Christoph Hellwig.
|
2009-05-27 10:10:42 +02:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it would be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2009-04-13 15:51:58 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
2009-04-13 15:51:58 +02:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=1 # failure is the default!
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
2013-03-15 12:28:04 +00:00
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
2009-04-13 15:51:58 +02:00
|
|
|
|
|
|
|
|
# real QA test starts here
|
2010-02-09 16:05:51 -06:00
|
|
|
_supported_fs generic
|
2009-04-13 15:51:58 +02:00
|
|
|
_supported_os Linux
|
|
|
|
|
|
|
|
|
|
_require_scratch
|
|
|
|
|
|
2010-03-06 11:24:38 +11:00
|
|
|
SIZE=`expr 104 \* 1024 \* 1024`
|
2010-02-09 16:05:51 -06:00
|
|
|
_scratch_mkfs_sized $SIZE &> /dev/null
|
2009-04-13 15:51:58 +02:00
|
|
|
_scratch_mount
|
|
|
|
|
|
2010-03-06 11:25:10 +11:00
|
|
|
# fix the reserve block pool to a known size so that the enospc calculations
|
|
|
|
|
# work out correctly.
|
2013-03-15 12:28:02 +00:00
|
|
|
_scratch_resvblks 1024 > $seqres.full 2>&1
|
2010-03-06 11:25:10 +11:00
|
|
|
|
2009-04-13 15:51:58 +02:00
|
|
|
for i in `seq 1 22500`; do
|
|
|
|
|
echo -n > $SCRATCH_MNT/$i
|
|
|
|
|
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
|
|
|
|
|
done
|
|
|
|
|
|
2013-09-03 00:14:53 +00:00
|
|
|
_check_scratch_fs
|
|
|
|
|
|
2009-04-13 15:51:58 +02:00
|
|
|
# success, all done
|
|
|
|
|
echo "*** done"
|
2013-03-15 12:28:02 +00:00
|
|
|
rm -f $seqres.full
|
2009-04-13 15:51:58 +02:00
|
|
|
status=0
|