cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001

This commit is contained in:
Nathan Scott
2001-01-15 05:01:19 +00:00
commit 27fba05e66
144 changed files with 21334 additions and 0 deletions
Executable
+314
View File
@@ -0,0 +1,314 @@
#! /bin/sh
#
# XFS QA Test No. 001
# $Id: 1.1 $
#
# Random file copier to produce chains of identical files so the head
# and the tail cna be diff'd at then end of each iteration.
#
# Exercises creat, write and unlink for a variety of directory sizes, and
# checks for data corruption.
#
# run [config]
#
# config has one line per file with filename and byte size, else use
# the default one below.
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=kenmcd@bruce.melbourne.sgi.com
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
tmp=/tmp/$$
here=`pwd`
status=1
done_cleanup=false
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
verbose=true
if [ $# -eq 0 ]
then
# use the default config
#
cat <<End-of-File >$tmp.config
# pathname size in bytes
#
small 10
big 102400
sub/small 10
sub/big 102400
#
sub/a 1
sub/b 2
sub/c 4
sub/d 8
sub/e 16
sub/f 32
sub/g 64
sub/h 128
sub/i 256
sub/j 512
sub/k 1024
sub/l 2048
sub/m 4096
sub/n 8192
#
sub/a00 100
sub/b00 200
sub/c00 400
sub/d00 800
sub/e00 1600
sub/f00 3200
sub/g00 6400
sub/h00 12800
sub/i00 25600
sub/j00 51200
sub/k00 102400
sub/l00 204800
sub/m00 409600
sub/n00 819200
#
sub/a000 1000
sub/e000 16000
sub/h000 128000
sub/k000 1024000
End-of-File
elif [ $# -eq 1 ]
then
if [ -f $1 ]
then
cp $1 $tmp.config
else
echo "Error: cannot open config \"$1\""
exit 1
fi
else
echo "Usage: run [config]"
exit 1
fi
ncopy=200 # number of file copies in the chain step
_setup()
{
if mkdir -p $TEST_DIR/$$
then
:
else
echo "Error: cannot mkdir \"$TEST_DIR/$$\""
exit 1
fi
cd $TEST_DIR/$$
$verbose && echo -n "setup "
sed -e '/^#/d' $tmp.config \
| while read file nbytes
do
dir=`dirname $file`
if [ "$dir" != "." ]
then
if [ ! -d $dir ]
then
if mkdir $dir
then
:
else
$verbose && echo
echo "Error: cannot mkdir \"$dir\""
exit 1
fi
fi
fi
rm -f $file
if $here/src/fill $file $file $nbytes
then
:
else
$verbose && echo
echo "Error: cannot create \"$file\""
exit 1
fi
$verbose && echo -n "."
done
$verbose && echo
}
_mark_iteration()
{
$verbose && echo -n "mark_iteration "
sed -e '/^#/d' $tmp.config \
| while read file nbytes
do
if [ ! -f $file ]
then
$verbose && echo
echo "Error: $file vanished!"
touch $tmp.bad
continue
fi
sed -e "s/ [0-9][0-9]* / $1 /" <$file >$file.tmp
mv $file.tmp $file
$verbose && echo -n "."
done
$verbose && echo
}
# for each file, make a number of copies forming a chain like foo.0,
# foo.1, foo.2, ... foo.N
#
# files are chosen at random, so the lengths of the chains are different
#
# then rename foo.N to foo.last and remove all of the other files in
# the chain
#
_chain()
{
$AWK_PROG <$tmp.config '
BEGIN { nfile = 0 }
/^\#/ { next }
{ file[nfile] = $1
link[nfile] = 0
nfile++
}
END { srand('$iter')
for (i=0; i < '$ncopy'; i++) {
# choose a file at random, and add one copy to that chain
j = -1
while (j < 0 || j >= nfile)
j = int(rand() * nfile)
if (link[j] == 0) {
printf "if [ ! -f %s ]; then echo \"%s missing!\"; exit; fi\n",file[j],file[j]
printf "if [ -f %s.0 ]; then echo \"%s.0 already present!\"; exit; fi\n",file[j],file[j]
printf "cp %s %s.0\n",file[j],file[j]
}
else {
printf "if [ ! -f %s.%d ]; then echo \"%s.%d missing!\"; exit; fi\n",file[j],link[j]-1,file[j],link[j]-1
printf "if [ -f %s.%d ]; then echo \"%s.%d already present!\"; exit; fi\n",file[j],link[j],file[j],link[j]
printf "cp %s.%d %s.%d\n",file[j],link[j]-1,file[j],link[j]
}
link[j]++
}
# close all the chains, and remove all of the files except
# the head of the chain
for (j=0; j<nfile; j++) {
if (link[j] > 0)
printf "mv %s.%d %s.last\n",file[j],link[j]-1,file[j]
for (i=0; i<link[j]-1; i++) {
printf "rm -f %s.%d\n",file[j],i
}
}
}' \
| sh
}
_check()
{
rm -f $tmp.bad
$verbose && echo -n "check "
sed -e '/^#/d' $tmp.config \
| while read file nbytes
do
if [ ! -f $file ]
then
$verbose && echo
echo "Error: $file vanished!"
touch $tmp.bad
continue
fi
if [ -f $file.last ]
then
if cmp $file $file.last >/dev/null 2>&1
then
$verbose && echo -n "."
else
$verbose && echo
echo "Error: corruption for $file ..."
diff -c $file $file.last
touch $tmp.bad
fi
else
$verbose && echo -n "."
fi
done
$verbose && echo
}
_cleanup()
{
# cleanup
#
if $done_cleanup
then
:
elif [ $status -eq 0 ]
then
$verbose && echo "cleanup"
cd /
rm -rf $TEST_DIR/$$
done_cleanup=true
fi
}
status=0
_cleanup
status=1
done_cleanup=false
_setup
# do the test
#
for iter in 1 2 3 4 5
do
echo -n "iter $iter chain ... "
_chain
_check
if [ -f $tmp.bad ]
then
echo "Fatal error: test abandoned without changes"
exit 1
fi
done
status=0
exit
+9
View File
@@ -0,0 +1,9 @@
QA output created by 001
cleanup
setup ....................................
iter 1 chain ... check ....................................
iter 2 chain ... check ....................................
iter 3 chain ... check ....................................
iter 4 chain ... check ....................................
iter 5 chain ... check ....................................
cleanup
Executable
+88
View File
@@ -0,0 +1,88 @@
#! /bin/sh
#
# XFS QA Test No. 002
# $Id: 1.1 $
#
# simple inode link count test for a regular file
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=kenmcd@sgi.com
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
# real QA test starts here
echo "Silence is goodness ..."
# ensure target directory exists
mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
touch $TEST_DIR/$tmp.1
for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
if [ "$l" -ne $x ]
then
echo "Arrgh, created link #$l and lstat64 looks like ..."
src/lstat64 $TEST_DIR/$tmp.1
status=1
fi
done
for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
do
x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
if [ "$l" -ne $x ]
then
echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
src/lstat64 $TEST_DIR/$tmp.1
status=1
fi
rm -f $TEST_DIR/$tmp.$l
done
# success, all done
exit
+2
View File
@@ -0,0 +1,2 @@
QA output created by 002
Silence is goodness ...
Executable
+104
View File
@@ -0,0 +1,104 @@
#! /bin/sh
#
# XFS QA Test No. 003
# $Id: 1.1 $
#
# exercise xfs_db bug #784078
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=nathans@melbourne.sgi.com
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
PATH=".:$PATH"
[ -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
if ! grep -q "current type is \"inode\"" $tmp.out
then
cat $tmp.out
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
+139
View File
@@ -0,0 +1,139 @@
#! /bin/sh
# XFS QA Test No. 004
# $Id: 1.1 $
#
# exercise xfs_db bug #789674 and other freesp functionality
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=nathans@sgi.com
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()
{
mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
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
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT # and then remount
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
_need_to_be_root
_require_scratch
# real QA test starts here
rm -f $seq.full
_populate_scratch
eval `df -P -T --block-size=512 $SCRATCH_MNT 2>&1 \
| $AWK_PROG 'END { printf "blocks=%u used=%u avail=%u\n", $3, $4, $5 }'`
echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seq.full
blksize=`xfs_db -r -c sb -c p $SCRATCH_DEV |grep blocksize |sed -e 's/.*= *//'`
if [ -z "$blksize" ]
then
echo "Arrgh ... cannot determine blocksize for $fs, xfs_db reports"
xfs_db -r -c sb -c p $SCRATCH_DEV
status=1
continue
fi
echo "blocksize from xfs_db is '$blksize'" >>$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
# check the 'blocks' field from freesp command is OK
perl -ne '
BEGIN { $avail ='$avail' * 512;
$answer="(no xfs_db free blocks line?)" }
/free blocks (\d+)$/ || next;
$freesp = $1 * '$blksize';
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
+3
View File
@@ -0,0 +1,3 @@
QA output created by 004
Checking blocks column same as df: yes
Checking percent column yields 100: 100
Executable
+87
View File
@@ -0,0 +1,87 @@
#! /bin/sh
# XFS QA Test No. 005
# $Id: 1.1 $
#
# Test symlinks & ELOOP
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=dxm@sgi.com
#
# note ELOOP limit used to be 32 but changed to 8. Who know what
# it might be next.
#
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 $TEST_DIR
rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
cd $TEST_DIR
o=empty_file
touch $o
for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
do
ln -s $o $f
o=$f
done
ln -s symlink_self symlink_self
echo "*** touch deep symlinks"
echo ""
touch symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
echo ""
echo "*** touch recusive symlinks"
echo ""
touch symlink_self
exit
+39
View File
@@ -0,0 +1,39 @@
QA output created by 005
*** touch deep symlinks
touch: symlink_08: Too many levels of symbolic links
touch: symlink_09: Too many levels of symbolic links
touch: symlink_10: Too many levels of symbolic links
touch: symlink_11: Too many levels of symbolic links
touch: symlink_12: Too many levels of symbolic links
touch: symlink_13: Too many levels of symbolic links
touch: symlink_14: Too many levels of symbolic links
touch: symlink_15: Too many levels of symbolic links
touch: symlink_16: Too many levels of symbolic links
touch: symlink_17: Too many levels of symbolic links
touch: symlink_18: Too many levels of symbolic links
touch: symlink_19: Too many levels of symbolic links
touch: symlink_20: Too many levels of symbolic links
touch: symlink_21: Too many levels of symbolic links
touch: symlink_22: Too many levels of symbolic links
touch: symlink_23: Too many levels of symbolic links
touch: symlink_24: Too many levels of symbolic links
touch: symlink_25: Too many levels of symbolic links
touch: symlink_26: Too many levels of symbolic links
touch: symlink_27: Too many levels of symbolic links
touch: symlink_28: Too many levels of symbolic links
touch: symlink_29: Too many levels of symbolic links
touch: symlink_30: Too many levels of symbolic links
touch: symlink_31: Too many levels of symbolic links
touch: symlink_32: Too many levels of symbolic links
touch: symlink_33: Too many levels of symbolic links
touch: symlink_34: Too many levels of symbolic links
touch: symlink_35: Too many levels of symbolic links
touch: symlink_36: Too many levels of symbolic links
touch: symlink_37: Too many levels of symbolic links
touch: symlink_38: Too many levels of symbolic links
touch: symlink_39: Too many levels of symbolic links
*** touch recusive symlinks
touch: symlink_self: Too many levels of symbolic links
Executable
+89
View File
@@ -0,0 +1,89 @@
#! /bin/sh
# XFS QA Test No. 006
# $Id: 1.1 $
#
# permname
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=dxm@sgi.com
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()
{
rm -rf $TEST_DIR/permname.$$
}
_count()
{
$AWK_PROG '
BEGIN { count = 0 }
{ count ++ }
END { print count " files created" }
'
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
mkdir $TEST_DIR/permname.$$
echo ""
echo "single thread permname"
echo "----------------------"
mkdir $TEST_DIR/permname.$$/a
cd $TEST_DIR/permname.$$/a
$here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
find . | _count
echo ""
echo "multi thread permname"
echo "----------------------"
mkdir $TEST_DIR/permname.$$/b
cd $TEST_DIR/permname.$$/b
$here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
find . | _count
exit
+11
View File
@@ -0,0 +1,11 @@
QA output created by 006
single thread permname
----------------------
alpha size = 4, name length = 6, total files = 4096, nproc=1
4097 files created
multi thread permname
----------------------
alpha size = 4, name length = 6, total files = 4096, nproc=4
4097 files created
Executable
+90
View File
@@ -0,0 +1,90 @@
#! /bin/sh
# XFS QA Test No. 007
# $Id: 1.1 $
#
# drive the src/nametest program
# which does a heap of open(create)/unlink/stat
# and checks that error codes make sense with its
# memory of the files created.
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=tes@sherman.melbourne.sgi.com
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()
{
rm -f $tmp.*
rm -rf $TEST_DIR/$seq
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
status=1 # default failure
sourcefile=$tmp.nametest
seed=1
iterations=100000
num_filenames=100
# need to create an input file with a list of
# filenames on each line
i=1
while [ $i -le $num_filenames ]; do
echo "nametest.$i" >>$sourcefile
i=`expr $i + 1`
done
mkdir $TEST_DIR/$seq
cd $TEST_DIR/$seq
$here/src/nametest -l $sourcefile -s $seed -i $iterations -z
#optional stuff if your test has verbose output to help resolve problems
#echo
#echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"
# success, all done
status=0
exit
+22
View File
@@ -0,0 +1,22 @@
QA output created by 007
.Seed = 1 (use "-s 1" to re-execute this test)
.......................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
....................................................
creates: 18736 OK, 18802 EEXIST ( 37538 total, 50% EEXIST)
removes: 18675 OK, 19927 ENOENT ( 38602 total, 51% ENOENT)
lookups: 12000 OK, 11860 ENOENT ( 23860 total, 49% ENOENT)
total : 49411 OK, 50589 w/error (100000 total, 50% w/error)
cleanup: 61 removes
Executable
+98
View File
@@ -0,0 +1,98 @@
#! /bin/sh
# XFS QA Test No. 008
# $Id: 1.1 $
#
# randholes test
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=dxm@sgi.com
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
trap "rm -f $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -rf $TEST_DIR/randholes.$$.*
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
_do_test()
{
_n="$1"
_holes="$2"
_param="$3"
out=$TEST_DIR/randholes.$$.$_n
echo ""
echo "randholes.$_n : $_param"
echo "------------------------------------------"
if $here/src/randholes $_param $out >$tmp.out
then
# 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
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
rm -f $here/$seq.out.full
_do_test 1 50 "-l 5000000 -c 50 -b 4096"
_do_test 2 100 "-l 10000000 -c 100 -b 4096"
_do_test 3 100 "-l 10000000 -c 100 -b 512" # test partial pages
# success, all done
exit
+13
View File
@@ -0,0 +1,13 @@
QA output created by 008
randholes.1 : -l 5000000 -c 50 -b 4096
------------------------------------------
holes is in range
randholes.2 : -l 10000000 -c 100 -b 4096
------------------------------------------
holes is in range
randholes.3 : -l 10000000 -c 100 -b 512
------------------------------------------
holes is in range
Executable
+197
View File
@@ -0,0 +1,197 @@
#! /bin/sh
# XFS QA Test No. 009
# $Id: 1.1 $
#
# alloc test
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=dxm@sgi.com
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
_cleanup()
{
echo "*** unmount"
umount $SCRATCH_MNT
}
_block_filter()
{
sed -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g'
}
_init()
{
echo "*** mkfs"
if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1
then
cat $tmp.out
echo "failed to mkfs $SCRATCH_DEV"
exit 1
fi
echo "*** mount"
if ! mount $SCRATCH_DEV $SCRATCH_MNT -t xfs
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
_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 4096 -f $out | _block_filter
r 0 1000b
m
EOF
_filesize $out
cat <<EOF | src/alloc -n -b 4096 -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 2 - reserve & filesize"
rm -f $out
cat <<EOF | src/alloc -n -b 4096 -f $out | _block_filter
r 0 1000b
EOF
_filesize $out
echo "*** test 3 - alloc & filesize"
rm -f $out
cat <<EOF | src/alloc -n -b 4096 -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 4096 -f $out | _block_filter
a 1000b
EOF
_filesize $out
cat <<EOF | src/alloc -n -b 4096 -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 5 - reserve / unreserve"
rm -f $out
cat <<EOF | src/alloc -n -b 4096 -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 4096 -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 4096 -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 4096 -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 4096 -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 4096
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 4096
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
filesize = 0
*** test 2 - reserve & filesize
blocksize 4096
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 4096
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 4096
CMD allocsp, off=4096000, len=-1
MAP off=4096000, len=-1 [1000-]
[ofs,count]: start..end
filesize = 4096000
blocksize 4096
MAP off=0, len=-1 [0-]
[ofs,count]: start..end
filesize = 0
*** test 5 - reserve / unreserve
blocksize 4096
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 4096
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 4096
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 4096
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 4096
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
+73
View File
@@ -0,0 +1,73 @@
#! /bin/sh
# XFS QA Test No. 010
# $Id: 1.1 $
#
# dbtest
#
#-----------------------------------------------------------------------
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 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.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
#-----------------------------------------------------------------------
#
# creator
owner=ivanr@sherman.melbourne.sgi.com
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
_cleanup()
{
rm -f $TEST_DIR/DBtest*.{pag,dir}
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
# filter random number output from dbtest
#
_filter_dbtest()
{
sed \
-e '/were [0-9][0-9]* duplicate/s//were BLEEP duplicate/' \
-e '/using [0-9][0-9]* as seed/s//using BLEEP as seed/'
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
cd $TEST_DIR
$here/src/dbtest -l 5 -n 3000 | _filter_dbtest
# success, all done
exit
+58
View File
@@ -0,0 +1,58 @@
QA output created by 010
dbtest v1.0
Creating database containing 3000 records...
performing lookups for 5 iterations...
using BLEEP as seed for srandom()...
There were BLEEP duplicate checksums generated
Performing lookups on database...
Sequential lookups...
Random lookups...
Lookups succeeded...
Performing lookups on database...
Sequential lookups...
Random lookups...
Lookups succeeded...
Performing lookups on database...
Sequential lookups...
Random lookups...
Lookups succeeded...
Performing lookups on database...
Sequential lookups...
Random lookups...
Lookups succeeded...
Performing lookups on database...
Sequential lookups...
Random lookups...
Lookups succeeded...
Cleaning up database...
There were BLEEP duplicate checksums generated

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