2010-04-29 09:59:24 +10:00
|
|
|
#! /bin/bash
|
2010-03-06 11:24:54 +11:00
|
|
|
# FS QA Test No. 225
|
|
|
|
|
#
|
|
|
|
|
# Run the fiemap (file extent mapping) tester
|
|
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Copyright (c) 2009 Eric Sandeen. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# 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
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
|
|
|
|
seqres=$RESULT_DIR/$seq
|
|
|
|
|
seqres=$RESULT_DIR/$seq
|
2010-03-06 11:24:54 +11:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=tmp/$$
|
|
|
|
|
status=1 # failure is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
cd /
|
|
|
|
|
rm -f $tmp.*
|
|
|
|
|
_cleanup_testdir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common.rc
|
|
|
|
|
. ./common.filter
|
|
|
|
|
|
|
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs generic
|
|
|
|
|
_supported_os Linux
|
2011-10-10 02:14:14 +00:00
|
|
|
_require_scratch
|
2010-03-06 11:24:54 +11:00
|
|
|
|
2011-10-10 02:14:14 +00:00
|
|
|
_scratch_mkfs > /dev/null 2>&1
|
|
|
|
|
_scratch_mount > /dev/null 2>&1
|
|
|
|
|
|
2013-03-15 12:28:02 +00:00
|
|
|
rm -f $seqres.full
|
2011-10-10 02:14:14 +00:00
|
|
|
fiemapfile=$SCRATCH_MNT/$seq.fiemap
|
|
|
|
|
fiemaplog=$SCRATCH_MNT/$seq.log
|
2010-03-06 11:24:54 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
|
|
|
|
|
|
2011-03-09 10:30:07 -06:00
|
|
|
seed=`date +%s`
|
|
|
|
|
|
|
|
|
|
echo "using seed $seed" >> $fiemaplog
|
|
|
|
|
|
2011-03-08 09:16:23 -06:00
|
|
|
echo "fiemap run without preallocation, with sync"
|
2011-03-09 10:30:07 -06:00
|
|
|
$here/src/fiemap-tester -q -S -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
|
2011-03-08 09:16:23 -06:00
|
|
|
|
2011-10-10 02:14:14 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
|
if grep -q "Operation not supported" $fiemaplog; then
|
|
|
|
|
_notrun "FIEMAP not supported by this filesystem type: $FSTYP"
|
|
|
|
|
fi
|
|
|
|
|
status=$?
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2011-03-08 09:16:23 -06:00
|
|
|
echo "fiemap run without preallocation or sync"
|
2011-03-09 10:30:07 -06:00
|
|
|
$here/src/fiemap-tester -q -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
|
2010-10-21 21:12:04 +02:00
|
|
|
|
2010-03-06 11:24:54 +11:00
|
|
|
status=0
|
|
|
|
|
exit
|