xfstests: move xfs specific tests out of top directory

And into tests/xfs. Tests found and moved via:

$ grep "supported_fs xfs$" [0-2]* | cut -d : -f 1 > xfs.tests
$ for i in `cat xfs.tests`; do
> git mv $i* tests/xfs/
> grep ^$i group >> tests/xfs/group
> sed -i -e "/^$i/d" group
> done

Output now looks like:

 sudo ./check -g quick -r
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-1 3.5.0-rc5-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

xfs/170  4s
generic/120      16s
generic/248      0s
generic/213      0s
generic/256      39s
xfs/121  6s
xfs/026  11s
generic/131      1s
xfs/187  1s
generic/135      0s
....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com did not move test 032, belongs in shared]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
Dave Chinner
2013-03-15 12:27:57 +00:00
committed by Rich Johnston
parent 797e625f28
commit fc48dfb966
378 changed files with 178 additions and 300 deletions
Executable
+91
View File
@@ -0,0 +1,91 @@
#! /bin/bash
# FS QA Test No. 003
#
# exercise xfs_db bug #784078
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2001 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
tmp=/tmp/$$
here=`pwd`
status=0 # success is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
_need_to_be_root
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
[ -f core ] && rm -f core
[ -f core ] && echo "Warning: can't nuke existing core file!"
test_done()
{
sts=$?
[ -f core ] && echo "FAILED - core file"
[ ! -f core -a $sts != 0 ] && echo "FAILED - non-zero exit status"
rm -f core
}
# real QA test starts here
echo "=== TEST 1 ==="
xfs_db -r -c 'pop' -c 'type sb' $TEST_DEV
test_done
echo "=== TEST 2 ==="
xfs_db -r -c 'push sb' $TEST_DEV
test_done
echo "=== TEST 3 ==="
xfs_db -r -c 'pop' -c 'push sb' $TEST_DEV
test_done
echo "=== TEST 4 ==="
xfs_db -r -c 'type sb' -c 'print' $TEST_DEV
test_done
echo "=== TEST 5 ==="
xfs_db -r -c 'inode 128' -c 'push' -c 'type' $TEST_DEV >$tmp.out 2>&1
test_done
# On IRIX we lose state after a "push" operation and don't
# know the type is still inode
# Probably not worth changing xfs_db on IRIX for this.
if [ "$HOSTOS" != "IRIX" ]; then
if ! grep -q "current type is \"inode\"" $tmp.out
then
cat $tmp.out
fi
fi
echo "=== TEST 6 ==="
xfs_db -r -c 'sb' -c 'a' $TEST_DEV >$tmp.out 2>&1 # don't care about output
test_done
echo "=== TEST 7 ==="
xfs_db -r -c 'ring' $TEST_DEV
test_done
+12
View File
@@ -0,0 +1,12 @@
QA output created by 003
=== TEST 1 ===
no current object
=== TEST 2 ===
=== TEST 3 ===
=== TEST 4 ===
no current object
no current type
=== TEST 5 ===
=== TEST 6 ===
=== TEST 7 ===
no entries in location ring.
Executable
+142
View File
@@ -0,0 +1,142 @@
#! /bin/bash
# FS QA Test No. 004
#
# exercise xfs_db bug #789674 and other freesp functionality
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2002 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0
_cleanup()
{
umount $SCRATCH_MNT
rm -f $tmp.*
exit $status
}
trap "_cleanup" 0 1 2 3 15
_populate_scratch()
{
echo "=== mkfs output ===" >>$seq.full
_scratch_mkfs_xfs | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
. $tmp.mkfs
_scratch_mount
dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &
wait
umount $SCRATCH_MNT # flush everything
_scratch_mount # and then remount
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
_need_to_be_root
_require_scratch
_require_no_large_scratch_dev
rm -f $seq.full
_populate_scratch
[ "$HOSTOS" = "Linux" ] && DF_PROG="$DF_PROG -P --block-size=512"
eval `$DF_PROG $SCRATCH_MNT 2>&1 \
| tail -1 | $AWK_PROG '{ printf "blocks=%u used=%u avail=%u\n", $3, $4, $5 }'`
echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seq.full
echo "blocksize from mkfs is '$dbsize'" >>$seq.full
xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
echo "xfs_db for $SCRATCH_DEV" >>$seq.full
cat $tmp.xfs_db >>$seq.full
eval `$XFS_IO_PROG -x -c resblks $SCRATCH_MNT 2>&1 \
| $AWK_PROG '/available/ { printf "resblks=%u\n", $5 }'`
echo "resblks gave: resblks=$resblks" >>$seq.full
# check the 'blocks' field from freesp command is OK
# since 2.6.18, df does not report the 4 blocks per AG that cannot
# be allocated, hence we check for that exact mismatch.
# since ~2.6.22, reserved blocks are used by default and df does
# not report them, hence check for an exact mismatch.
perl -ne '
BEGIN { $avail ='$avail' * 512;
$answer="(no xfs_db free blocks line?)" }
/free blocks (\d+)$/ || next;
$freesp = $1 * '$dbsize';
if ($freesp == $avail) {
$answer = "yes";
} else {
$avail = $avail + (('$agcount' + 1) * '$dbsize' * 4);
if ($freesp == $avail) {
$answer = "yes";
} else {
$avail = $avail + ('$resblks' * '$dbsize');
if ($freesp == $avail) {
$answer = "yes";
} else {
$answer = "no ($freesp != $avail)";
}
}
}
END { print "$answer\n" }
' <$tmp.xfs_db >$tmp.ans
ans="`cat $tmp.ans`"
echo "Checking blocks column same as df: $ans"
if [ "$ans" != yes ]
then
echo "Error: $SCRATCH_DEV: freesp mismatch: $ans"
echo "xfs_db output ..."
cat $tmp.xfs_db
status=1
fi
# check the 'pct' field from freesp command is good
perl -ne '
BEGIN { $percent = 0; }
/free/ && next; # skip over free extent size number
if (/\s+(\d+\.\d+)$/) {
$percent += $1;
}
END { $percent += 0.5; print int($percent), "\n" } # round up
' <$tmp.xfs_db >$tmp.ans
ans="`cat $tmp.ans`"
echo "Checking percent column yields 100: $ans"
if [ "$ans" != 100 ]
then
echo "Error: $SCRATCH_DEV: pct mismatch: $ans (expected 100)"
echo "xfs_db output ..."
cat $tmp.xfs_db
status=1
fi
exit
+9
View File
@@ -0,0 +1,9 @@
QA output created by 004
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
Checking blocks column same as df: yes
Checking percent column yields 100: 100
Executable
+116
View File
@@ -0,0 +1,116 @@
#! /bin/bash
# FS QA Test No. 008
#
# randholes test
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2002 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
pgsize=`$here/src/feature -s`
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -f $tmp.*
rm -rf $testdir/randholes.$$.*
_cleanup_testdir
}
_filter()
{
sed -e "s/-b $pgsize/-b PGSIZE/g" \
-e "s/-l .* -c/-l FSIZE -c/g"
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
_do_test()
{
_n="$1"
_holes="$2"
_param="$3"
out=$testdir/randholes.$$.$_n
echo ""
echo "randholes.$_n : $_param" | _filter
echo "------------------------------------------"
if $here/src/randholes $_param $out >$tmp.out
then
# only check if we're not allocating in huge chunks (extsz flag)
if _test_inode_flag extsize $out || _test_inode_flag realtime $out
then
echo "holes is in range"
else
# quick check - how many holes did we get?
count=`xfs_bmap $out | egrep -c ': hole'`
# blocks can end up adjacent, therefore number of holes varies
_within_tolerance "holes" $count $_holes 10% -v
fi
else
echo " randholes returned $? - see $seq.out.full"
echo "--------------------------------------" >>$here/$seq.out.full
echo "$_n - output from randholes:" >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
cat $tmp.out >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
echo "$_n - output from bmap:" >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
xfs_bmap -vvv $out >>$here/$seq.out.full
status=1
fi
}
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
_setup_testdir
rm -f $here/$seq.out.full
# Note on special numbers here.
#
# We are trying to create roughly 50 or 100 holes in a file
# using random writes. Assuming a good distribution of 50 writes
# in a file, the file only needs to be 3-4x the size of the write
# size muliplied by the number of writes. Hence we use 200 * pgsize
# for files we want 50 holes in and 400 * pgsize for files we want
# 100 holes in. This keeps the runtime down as low as possible.
#
_do_test 1 50 "-l `expr 200 \* $pgsize` -c 50 -b $pgsize"
_do_test 2 100 "-l `expr 400 \* $pgsize` -c 100 -b $pgsize"
_do_test 3 100 "-l `expr 400 \* $pgsize` -c 100 -b 512" # test partial pages
# rinse, lather, repeat for direct IO
_do_test 4 50 "-d -l `expr 200 \* $pgsize` -c 50 -b $pgsize"
_do_test 5 100 "-d -l `expr 400 \* $pgsize` -c 100 -b $pgsize"
# note: direct IO requires page aligned IO
# todo: realtime.
# success, all done
exit
+21
View File
@@ -0,0 +1,21 @@
QA output created by 008
randholes.1 : -l FSIZE -c 50 -b PGSIZE
------------------------------------------
holes is in range
randholes.2 : -l FSIZE -c 100 -b PGSIZE
------------------------------------------
holes is in range
randholes.3 : -l FSIZE -c 100 -b 512
------------------------------------------
holes is in range
randholes.4 : -d -l FSIZE -c 50 -b PGSIZE
------------------------------------------
holes is in range
randholes.5 : -d -l FSIZE -c 100 -b PGSIZE
------------------------------------------
holes is in range
Executable
+187
View File
@@ -0,0 +1,187 @@
#! /bin/bash
# FS QA Test No. 009
#
# XFS allocator test (preallocation - allocp, resvsp ,etc)
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2002 Silicon Graphics, Inc. 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`
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
# This isn't really related to fs block size, it's just what
# alloc uses for the "block" unit in it's input parameters...
bsize=4096
_cleanup()
{
echo "*** unmount"
umount $SCRATCH_MNT
}
_block_filter()
{
sed \
-e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' \
-e "s/blocksize $bsize/blocksize BSIZE/g"
}
_init()
{
echo "*** mkfs"
if ! _scratch_mkfs_xfs >$tmp.out 2>&1
then
cat $tmp.out
echo "failed to mkfs $SCRATCH_DEV"
exit 1
fi
echo "*** mount"
if ! _scratch_mount
then
echo "failed to mount $SCRATCH_DEV"
exit 1
fi
}
_filesize()
{
ls -l $1 | $AWK_PROG '{print "filesize = " $5}'
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
_require_scratch
_init
out=$SCRATCH_MNT/$$.tmp
# since we're using a clean FS here, we make some assumptions
# about availability of contiguous blocks
# also interesting to note is that ALLOC == FREE. seriously.
# the _length is ignored_ in irix. the file is allocated up
# to the specified offset, and zero filled if previously
# unallocated. the file is truncated at the specified point.
echo "*** test 1 - reservations cleared on O_TRUNC"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
m
EOF
_filesize $out
cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 2 - reserve & filesize"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
EOF
_filesize $out
echo "*** test 3 - alloc & filesize"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
EOF
_filesize $out
echo "*** test 4 - allocations cleared on O_TRUNC"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
EOF
_filesize $out
cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 5 - reserve / unreserve"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
r 0 100b
u 100b 500b
m
u 900b 200b
m
EOF
echo "*** test 6 - reserve adjacent"
rm -f $out
cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
r 0 100b
r 100b 100b
m
EOF
echo "*** test 7 - alloc"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
m
a 2000b
m
EOF
_filesize $out
echo "*** test 8 - alloc & truncate"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
m
t 500b
m
EOF
_filesize $out
echo "*** test 9 - reserve & truncate"
rm -f $out
cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
m
t 500b
m
EOF
_filesize $out
status=0
exit
+114
View File
@@ -0,0 +1,114 @@
QA output created by 009
*** mkfs
*** mount
*** test 1 - reservations cleared on O_TRUNC
blocksize BSIZE
CMD resvsp, off=0, len=4096000
MAP off=0, len=4096000 [0,1000]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
filesize = 0
blocksize BSIZE
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
filesize = 0
*** test 2 - reserve & filesize
blocksize BSIZE
CMD resvsp, off=0, len=4096000
MAP off=0, len=4096000 [0,1000]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
filesize = 0
*** test 3 - alloc & filesize
blocksize BSIZE
CMD allocsp, off=4096000, len=-1
MAP off=4096000, len=-1 [1000-]
[ofs,count]: start..end
filesize = 4096000
*** test 4 - allocations cleared on O_TRUNC
blocksize BSIZE
CMD allocsp, off=4096000, len=-1
MAP off=4096000, len=-1 [1000-]
[ofs,count]: start..end
filesize = 4096000
blocksize BSIZE
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
filesize = 0
*** test 5 - reserve / unreserve
blocksize BSIZE
CMD resvsp, off=0, len=409600
MAP off=0, len=409600 [0,100]
[ofs,count]: start..end
[0,100]: BLOCKRANGE
CMD unresvsp, off=409600, len=2048000
MAP off=409600, len=2048000 [100,500]
[ofs,count]: start..end
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,100]: BLOCKRANGE
CMD unresvsp, off=3686400, len=819200
MAP off=3686400, len=819200 [900,200]
[ofs,count]: start..end
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,100]: BLOCKRANGE
*** test 6 - reserve adjacent
blocksize BSIZE
CMD resvsp, off=0, len=409600
MAP off=0, len=409600 [0,100]
[ofs,count]: start..end
[0,100]: BLOCKRANGE
CMD resvsp, off=409600, len=409600
MAP off=409600, len=409600 [100,100]
[ofs,count]: start..end
[100,100]: BLOCKRANGE
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,200]: BLOCKRANGE
*** test 7 - alloc
blocksize BSIZE
CMD allocsp, off=4096000, len=-1
MAP off=4096000, len=-1 [1000-]
[ofs,count]: start..end
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
CMD allocsp, off=8192000, len=-1
MAP off=8192000, len=-1 [2000-]
[ofs,count]: start..end
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,2000]: BLOCKRANGE
filesize = 8192000
*** test 8 - alloc & truncate
blocksize BSIZE
CMD allocsp, off=4096000, len=-1
MAP off=4096000, len=-1 [1000-]
[ofs,count]: start..end
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
TRUNCATE off=2048000
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,500]: BLOCKRANGE
filesize = 2048000
*** test 9 - reserve & truncate
blocksize BSIZE
CMD resvsp, off=0, len=4096000
MAP off=0, len=4096000 [0,1000]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
TRUNCATE off=2048000
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
[0,1000]: BLOCKRANGE
filesize = 2048000
*** unmount
Executable
+121
View File
@@ -0,0 +1,121 @@
#! /bin/bash
# FS QA Test No. 012
#
# holes
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2001 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
rm -rf $testdir/holes.$$.*
_cleanup_testdir
}
_filesize()
{
ls -l $1 | $AWK_PROG '{print " filesize = " $5}'
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
_do_test()
{
_n="$1"
_param="$2"
_count="$3"
failed=0
out=$testdir/holes.$$.$_n
echo ""
echo "holes.$_n : $_param"
echo "-----------------------------------------------"
if ! $here/src/holes $_param $out >$tmp.out
then
echo " holes returned $? - see $seq.out.full"
failed=1
status=1
fi
if [ $failed -eq 0 ]
then
# quick check - how many holes did we get?
count=`xfs_bmap $out | egrep -c ': hole'`
echo " $count hole(s) detected"
# and how big was the file?
_filesize $out
if [ $count -ne $_count ]
then
echo " unexpected number of holes - see $seq.out.full"
status=1
failed=1
fi
fi
if [ $failed -eq 1 ]
then
echo "--------------------------------------" >>$here/$seq.out.full
echo "$_n - output from holes:" >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
cat $tmp.out >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
echo "$_n - output from bmap:" >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
xfs_bmap -vvv $out >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
echo "$_n - output from ls -li:" >>$here/$seq.out.full
echo "--------------------------------------" >>$here/$seq.out.full
ls -li $out >>$here/$seq.out.full
status=1
fi
}
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
_setup_testdir
rm -f $here/$seq.out.full
# small & fairly dense
_do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100
# big & sparse
_do_test 2 "-l 409600000 -b 40960 -i 1000 -c 1" 10
# no holes, but a very nasty way to write a file (lots of extents)
_do_test 3 "-l 40960000 -b 40960 -i 10 -c 10" 0
exit
+16
View File
@@ -0,0 +1,16 @@
QA output created by 012
holes.1 : -l 40960000 -b 40960 -i 10 -c 1
-----------------------------------------------
100 hole(s) detected
filesize = 40960000
holes.2 : -l 409600000 -b 40960 -i 1000 -c 1
-----------------------------------------------
10 hole(s) detected
filesize = 409600000
holes.3 : -l 40960000 -b 40960 -i 10 -c 10
-----------------------------------------------
0 hole(s) detected
filesize = 40960000
Executable
+247
View File
@@ -0,0 +1,247 @@
#! /bin/bash
# FS QA Test No. 016
#
# test end of log overwrite bug #796141
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2003 Silicon Graphics, Inc. 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
#
#-----------------------------------------------------------------------
#
#
# pv 796141
#
# create a new FS, mostly fill the log. Then wrap the log back to the
# start bit by bit to force wiping of stale blocks near the end of the
# log. Check the block after the log ends to check for corruption
#
# assumptions :
# - given we're only touching a single inode, the block after the
# log which is in the middle ag should never be touched.
# if it changes, we assume the log is writing over it
#
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
echo "*** unmount"
umount $SCRATCH_MNT 2>/dev/null
}
_block_filter()
{
sed -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g'
}
_init()
{
echo "*** reset partition"
$here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV
echo "*** mkfs"
force_opts="-dsize=50m -lsize=$log_size"
#
# Do not discard blocks as we check for patterns in free space.
#
# First, make sure that mkfs supports '-K' option by using its
# dry run (-N option) and then add it to the force_opts.
#
if _scratch_mkfs_xfs -N -K $force_opts >/dev/null 2>&1; then
force_opts="-K $force_opts"
fi
echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full
_scratch_mkfs_xfs $force_opts >$tmp.mkfs0 2>&1
[ $? -ne 0 ] && \
_notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
_filter_mkfs <$tmp.mkfs0 >/dev/null 2>$tmp.mkfs
. $tmp.mkfs
[ $logsunit -ne 0 ] && \
_notrun "Cannot run this test using log MKFS_OPTIONS specified"
}
_log_traffic()
{
count=$1
echo "*** generate log traffic"
out=$SCRATCH_MNT/$$.tmp
echo " *** mount"
if ! _scratch_mount
then
echo "failed to mount $SCRATCH_DEV"
exit 1
fi
# having any quota enabled (acct/enfd) means extra log traffic - evil!
$here/src/feature -U $SCRATCH_DEV && \
_notrun "UQuota are enabled, test needs controlled log traffic"
$here/src/feature -G $SCRATCH_DEV && \
_notrun "GQuota are enabled, test needs controlled log traffic"
$here/src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled log traffic"
echo " *** fiddle"
while [ $count -ge 0 ]
do
touch $out
sync
rm $out
sync
let "count = count - 1"
done
echo " *** unmount"
if ! umount $SCRATCH_DEV
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
fi
}
_log_size()
{
_scratch_xfs_logprint -tb | $AWK_PROG '
/log file: / || /log device: / { print $7}
'
}
_log_head()
{
_scratch_xfs_logprint -tb | $AWK_PROG '
/head:/ { print $5 }
'
}
# Get log stripe unit for v2 logs; if none specified,
# (or v1 log) just return "1" block
_log_sunit()
{
if [ ${lsunit:-0} -eq 0 ]; then
echo $dbsize
else
expr $lsunit \* $dbsize
fi
}
_after_log()
{
xfs_db -r $1 -c "sb" -c "print" | $AWK_PROG '
/logstart/ { logstart = $3 }
/logblocks/ { logblocks = $3 }
END {
print logstart + logblocks
}
'
}
_check_corrupt()
{
f="c6c6c6c6"
echo "*** check for corruption"
echo "expect $f..." >>$seq.full
xfs_db -r -c "fsblock $2" -c "print" $1 | head | tee -a $seq.full | \
grep -q -v "$f $f $f $f $f $f $f $f" && \
_fail "!!! block $2 corrupted!"
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
_supported_fs xfs
_supported_os Linux
rm -f $seq.full
# mkfs sizes
log_size=2097152
log_size_bb=`expr $log_size / 512`
_require_scratch
_init
block=`_after_log $SCRATCH_DEV`
echo "fsblock after log = $block" >>$seq.full
_check_corrupt $SCRATCH_DEV $block
actual_log_size=`_log_size`
echo "log size = $actual_log_size BB" >>$seq.full
head=`_log_head`
echo "log position = $head" >>$seq.full
lsunit=`_log_sunit`
echo "log sunit = $lsunit" >>$seq.full
# sanity checks
[ $actual_log_size -eq $log_size_bb ] || \
_fail "!!! unexpected log size $size"
[ $head -eq 2 -o $head -eq $((lsunit/512)) ] || \
_fail "!!! unexpected initial log position $head vs. $((lsunit/512))"
# find how how many blocks per op for 100 ops
# ignore the fact that it will also include an unmount record etc...
# this should be small overall
echo " lots of traffic for sampling" >>$seq.full
sample_size_ops=100
_log_traffic $sample_size_ops
head1=`_log_head`
num_blocks=`expr $head1 - $head`
blocks_per_op=`echo "scale=3; $num_blocks / $sample_size_ops" | bc`
echo "blocks_per_op = $blocks_per_op" >>$seq.full
num_expected_ops=`echo "$log_size_bb / $blocks_per_op" | bc`
echo "num_expected_ops = $num_expected_ops" >>$seq.full
num_expected_to_go=`echo "$num_expected_ops - $sample_size_ops" | bc`
echo "num_expected_to_go = $num_expected_to_go" >>$seq.full
echo " lots more traffic" >>$seq.full
_log_traffic $num_expected_to_go
head=`_log_head`
echo "log position = $head" >>$seq.full
# e.g. 3891
near_end_min=`echo "0.95 * $log_size_bb" | bc | sed 's/\..*//'`
echo "near_end_min = $near_end_min" >>$seq.full
[ $head -gt $near_end_min -a $head -lt $log_size_bb ] || \
_fail "!!! unexpected near end log position $head"
for c in `seq 0 20`
do
echo " little traffic" >>$seq.full
_log_traffic 2
head=`_log_head`
echo "log position = $head" >>$seq.full
_check_corrupt $SCRATCH_DEV $block
done
[ $head -lt 1000 ] || \
_fail "!!! unexpected wrapped log position $head"
# success, all done
status=0
exit
+119
View File
@@ -0,0 +1,119 @@
QA output created by 016
*** reset partition
Wrote 51200.00Kb (value 0xc6)
*** mkfs
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** generate log traffic
*** mount
*** fiddle
*** unmount
*** check for corruption
*** unmount
Executable
+94
View File
@@ -0,0 +1,94 @@
#! /bin/bash
# FS QA Test No. 017
#
# test remount ro - pv 795642
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2002 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_cleanup()
{
echo "*** unmount"
umount $SCRATCH_MNT 2>/dev/null
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_scratch
# xfs_db will OOM kill the machine if you don't have huge amounts of RAM, so
# don't run this on large filesystems.
_require_no_large_scratch_dev
echo "*** init FS"
rm -f $seq.full
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
echo "" >>$seq.full
_scratch_mkfs_xfs >>$seq.full 2>&1 \
|| _fail "mkfs failed"
_scratch_mount >>$seq.full 2>&1 \
|| _fail "mount failed"
echo "*** test"
for l in 0 1 2 3 4
do
echo " *** test $l"
FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID`
$FSSTRESS_PROG $FSSTRESS_ARGS >>$seq.full
_scratch_mount -o remount,ro \
|| _fail "remount ro failed"
echo "" >>$seq.full
echo "*** xfs_logprint ***" >>$seq.full
echo "" >>$seq.full
_scratch_xfs_logprint -tb | tee -a $seq.full \
| head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
echo "" >>$seq.full
echo "*** XFS_CHECK ***" >>$seq.full
echo "" >>$seq.full
_scratch_xfs_check >>$seq.full 2>&1 \
|| _fail "xfs_check failed"
_scratch_mount -o remount,rw \
|| _fail "remount rw failed"
done
echo "*** done"
# happy exit
rm -f $seq.full
status=0
exit 0
+10
View File
@@ -0,0 +1,10 @@
QA output created by 017
*** init FS
*** test
*** test 0
*** test 1
*** test 2
*** test 3
*** test 4
*** done
*** unmount
Executable
+102
View File
@@ -0,0 +1,102 @@
#! /bin/bash
# FS QA Test No. 018
#
# xfs_logprint test - test v2 logs of different LR sizes
#
#-----------------------------------------------------------------------
# Copyright (c) 2000-2002 Silicon Graphics, Inc. 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`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
. ./common.log
_cleanup()
{
cd /
_cleanup_logfiles
rm -f $tmp.*
umount $SCRATCH_MNT 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
# prelim
rm -f $seq.full $tmp.*
_require_scratch
_require_v2log
# link correct .out file
_link_out_file $seq.op
echo "*** init FS"
umount $SCRATCH_DEV >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
version=1 logbsize=32k
version=2 logbsize=32k
version=2 logbsize=64k
version=2 logbsize=128k
version=2 logbsize=256k
EOF
if [ "$HOSTOS" = "IRIX" ]; then
start_blk=0
else
start_blk=2
fi
# do the work for various log params which
# should not effect the data content of the log
cat $tmp.seq.params \
| while read mkfs mnt
do
if [ "$mkfs" = "#" ]; then
continue
fi
export MOUNT_OPTIONS="-o noalign,$mnt"
_mkfs_log "-l $mkfs"
_create_log
_check_log
_print_operation
_cmp_op_output $seq.op $filtered
_print_transaction_inode $start_blk
_cmp_output $seq.trans_inode $filtered
_print_transaction_buf $start_blk
_cmp_output $seq.trans_buf $filtered
done
# got thru it all so we may have success
status=0
exit
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
QA output created by 018
*** init FS
*** compare logprint: 018.op with 018.fulldir/op.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=1.filtered
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=1.filtered
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=1.filtered
*** compare logprint: 018.op with 018.fulldir/op.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-onoalign,logbsize=32k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.op with 018.fulldir/op.mnt-onoalign,logbsize=64k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-onoalign,logbsize=64k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-onoalign,logbsize=64k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.op with 018.fulldir/op.mnt-onoalign,logbsize=128k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-onoalign,logbsize=128k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-onoalign,logbsize=128k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.op with 018.fulldir/op.mnt-onoalign,logbsize=256k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_inode with 018.fulldir/trans_inode.mnt-onoalign,logbsize=256k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
*** compare logprint: 018.trans_buf with 018.fulldir/trans_buf.mnt-onoalign,logbsize=256k.mkfs-lsize=2000b-llazy-count=1-lversion=2.filtered
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More