mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: move generic tests out of top level dir
And into tests/generic. Tests were found simply by grepping for the __supported_fs field in the tests. Output starts to look 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 ./242 1s ./183 2s generic/236 1s generic/014 1s generic/258 0s ./096 1s generic/245 0s ^C Ran: ./242 ./183 generic/236 generic/014 generic/258 ./096 generic/245 Passed all 7 tests Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Phil White <pwhite@sgi.com> [rjohnston@sgi.com added TOT changes] Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
35424188a9
commit
797e625f28
Executable
+319
@@ -0,0 +1,319 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 001
|
||||
#
|
||||
# Random file copier to produce chains of identical files so the head
|
||||
# and the tail can be diff'd at the 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-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=1
|
||||
done_cleanup=false
|
||||
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
verbose=true
|
||||
verify=$here/verify_fill
|
||||
|
||||
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
|
||||
udf_fsize=20240 # number of sectors for UDF
|
||||
|
||||
_setup()
|
||||
{
|
||||
if mkdir -p $testdir/$$
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "Error: cannot mkdir \"$testdir/$$\""
|
||||
exit 1
|
||||
fi
|
||||
cd $testdir/$$
|
||||
|
||||
$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 -v full_file=$here/$seq.full -v verify=$verify <$tmp.config '
|
||||
BEGIN { nfile = 0 }
|
||||
/^\#/ { next }
|
||||
{ file[nfile] = $1
|
||||
size[nfile] = $2
|
||||
link[nfile] = 0
|
||||
nfile++
|
||||
total_size += $2
|
||||
}
|
||||
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) {
|
||||
# previous should already exist and next one should not exist
|
||||
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 || exit 1\n",file[j],file[j]
|
||||
printf "ls -i %s.0\n", file[j] >full_file;
|
||||
total_size += size[j]
|
||||
printf "# total size = %d\n", total_size
|
||||
}
|
||||
else {
|
||||
# previous should already exist and next one should not exist
|
||||
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 || exit 1\n",file[j],link[j]-1,file[j],link[j]
|
||||
printf "ls -i %s.%d\n", file[j], link[j] >full_file;
|
||||
total_size += size[j]
|
||||
printf "# total size = %d\n", total_size
|
||||
}
|
||||
link[j]++
|
||||
}
|
||||
# close all the chains,
|
||||
# if have at least one copy then move the last copy to "file[j].last"
|
||||
# and remove all of the other 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]
|
||||
printf "ls -i %s.last\n", file[j] >full_file;
|
||||
}
|
||||
for (i=0; i<link[j]-1; i++) {
|
||||
printf "rm -f %s.%d\n",file[j],i
|
||||
}
|
||||
}
|
||||
}' \
|
||||
| tee -a $here/$seq.full | sh
|
||||
}
|
||||
|
||||
_check()
|
||||
{
|
||||
rm -f $tmp.bad
|
||||
$verbose && echo -n "check "
|
||||
sed -e '/^#/d' $tmp.config \
|
||||
| while read file nbytes
|
||||
do
|
||||
# the file is never removed so it should exist
|
||||
if [ ! -f $file ]
|
||||
then
|
||||
$verbose && echo
|
||||
echo "Error: $file vanished!"
|
||||
touch $tmp.bad
|
||||
continue
|
||||
fi
|
||||
# checks that the file and its last copy are the same
|
||||
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 $testdir/$$
|
||||
_cleanup_testdir
|
||||
done_cleanup=true
|
||||
fi
|
||||
}
|
||||
|
||||
rm -f $here/$seq.full
|
||||
status=0
|
||||
_cleanup
|
||||
status=1
|
||||
done_cleanup=false
|
||||
|
||||
_setup_testdir
|
||||
_setup
|
||||
|
||||
# do the test
|
||||
#
|
||||
for iter in 1 2 3 4 5
|
||||
do
|
||||
echo -n "iter $iter chain ... "
|
||||
echo "iter $iter" >> $here/$seq.full
|
||||
_chain
|
||||
_check
|
||||
if [ -f $tmp.bad ]
|
||||
then
|
||||
echo "Fatal error: test abandoned without changes"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
status=0
|
||||
exit
|
||||
@@ -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
+80
@@ -0,0 +1,80 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 002
|
||||
#
|
||||
# simple inode link count test for a regular file
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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 "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
rm -f $tmp.*
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
echo "Silence is goodness ..."
|
||||
|
||||
# ensure target directory exists
|
||||
mkdir `dirname $testdir/$tmp` 2>/dev/null
|
||||
|
||||
touch $testdir/$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 $testdir/$tmp.1 $testdir/$tmp.$l
|
||||
x=`src/lstat64 $testdir/$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 $testdir/$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 $testdir/$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 $testdir/$tmp.1
|
||||
status=1
|
||||
fi
|
||||
rm -f $testdir/$tmp.$l
|
||||
done
|
||||
|
||||
# success, all done
|
||||
exit
|
||||
@@ -0,0 +1,2 @@
|
||||
QA output created by 002
|
||||
Silence is goodness ...
|
||||
Executable
+99
@@ -0,0 +1,99 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 005
|
||||
#
|
||||
# Test symlinks & ELOOP
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2000-2004 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
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
|
||||
#
|
||||
# Note1: On Linux, ELOOP limit used to be 32 but changed to 8, and lately
|
||||
# its become 5. Who knows what it might be next.
|
||||
# Note2: On IRIX, the limit is around the 30 mark.
|
||||
#
|
||||
# What we are looking for here is: no panic due to blowing the stack;
|
||||
# and that the ELOOP error code is returned at some point (the actual
|
||||
# limit point is unimportant, just checking that we do hit it).
|
||||
#
|
||||
|
||||
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 $testdir
|
||||
rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
|
||||
cd /
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
_touch()
|
||||
{
|
||||
# On IRIX: Too many symbolic links in path name traversal
|
||||
# On Linux: Too many levels of symbolic links
|
||||
touch $@ 2>&1 | grep -q 'Too many.*symbolic links'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "ELOOP returned. Good."
|
||||
else
|
||||
echo "No ELOOP? Unexpected!"
|
||||
fi
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
|
||||
# IRIX UDF does not support symlinks
|
||||
if [ $FSTYP == 'udf' ]; then
|
||||
_supported_os Linux
|
||||
else
|
||||
_supported_os Linux IRIX
|
||||
fi
|
||||
|
||||
_setup_testdir
|
||||
|
||||
cd $testdir
|
||||
|
||||
o=empty_file
|
||||
touch $o
|
||||
for f in symlink_{0,1,2,3,4}{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,4}{0,1,2,3,4,5,6,7,8,9}
|
||||
echo ""
|
||||
echo "*** touch recusive symlinks"
|
||||
echo ""
|
||||
_touch symlink_self
|
||||
|
||||
exit
|
||||
@@ -0,0 +1,8 @@
|
||||
QA output created by 005
|
||||
*** touch deep symlinks
|
||||
|
||||
ELOOP returned. Good.
|
||||
|
||||
*** touch recusive symlinks
|
||||
|
||||
ELOOP returned. Good.
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 006
|
||||
#
|
||||
# permname
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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/permname.$$
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
_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
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
mkdir $testdir/permname.$$
|
||||
|
||||
echo ""
|
||||
echo "single thread permname"
|
||||
echo "----------------------"
|
||||
mkdir $testdir/permname.$$/a
|
||||
cd $testdir/permname.$$/a
|
||||
$here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
|
||||
find . | _count
|
||||
|
||||
echo ""
|
||||
echo "multi thread permname"
|
||||
echo "----------------------"
|
||||
mkdir $testdir/permname.$$/b
|
||||
cd $testdir/permname.$$/b
|
||||
$here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
|
||||
find . | _count
|
||||
|
||||
exit
|
||||
@@ -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
+74
@@ -0,0 +1,74 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 007
|
||||
#
|
||||
# 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-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/$seq
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
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
|
||||
let i=$i+1
|
||||
done
|
||||
|
||||
mkdir $testdir/$seq
|
||||
cd $testdir/$seq
|
||||
$here/src/nametest -l $sourcefile -s $seed -i $iterations -z
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -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
+69
@@ -0,0 +1,69 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 010
|
||||
#
|
||||
# dbtest
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
rm -f $tmp.*
|
||||
rm -f $testdir/DBtest*.{pag,dir}
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
[ -x $here/src/dbtest ] || _notrun "dbtest was not built for this platform"
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
rm -f $seq.full
|
||||
|
||||
cd $testdir
|
||||
|
||||
$here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $here/$seq.full | _filter_dbtest
|
||||
|
||||
# success, all done
|
||||
exit
|
||||
@@ -0,0 +1,58 @@
|
||||
QA output created by 010
|
||||
dbtest v1.0
|
||||
|
||||
Creating database containing 1000 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
|
||||
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 011
|
||||
#
|
||||
# dirstress
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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"
|
||||
|
||||
out=""
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=0 # success is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
rm -f $tmp.*
|
||||
[ -n "$out" ] && rm -rf $out
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
out=$testdir/dirstress.$$
|
||||
|
||||
rm -f $seq.full
|
||||
|
||||
_test()
|
||||
{
|
||||
test="$1"
|
||||
args="$2"
|
||||
count="$3"
|
||||
|
||||
echo "*** TEST $test $args -f <count>"
|
||||
if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1
|
||||
then
|
||||
echo " dirstress failed"
|
||||
echo "*** TEST $test -d $out -f $count $args" >>$seq.full
|
||||
cat $tmp.out >>$seq.full
|
||||
status=1
|
||||
fi
|
||||
}
|
||||
|
||||
# dirstress doesn't check returns - this is a crash & burn test.
|
||||
if ! mkdir $out
|
||||
then
|
||||
echo "!! couldn't mkdir $out"
|
||||
status=1
|
||||
exit
|
||||
fi
|
||||
|
||||
count=1000
|
||||
_test 1 "-p 1 -n 1" $count
|
||||
_test 2 "-p 5 -n 1" $count
|
||||
_test 3 "-p 5 -n 5" $count
|
||||
|
||||
# if error
|
||||
exit
|
||||
@@ -0,0 +1,4 @@
|
||||
QA output created by 011
|
||||
*** TEST 1 -p 1 -n 1 -f <count>
|
||||
*** TEST 2 -p 5 -n 1 -f <count>
|
||||
*** TEST 3 -p 5 -n 5 -f <count>
|
||||
Executable
+136
@@ -0,0 +1,136 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 013
|
||||
#
|
||||
# fsstress
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
# we might get here with a RO FS
|
||||
mount -o remount,rw $TEST_DEV >/dev/null 2>&1
|
||||
# now remove fsstress directory.
|
||||
# N.B. rm(1) on IRIX can find problems when building up a long pathname
|
||||
# such that what it has is greater the 1024 chars and will
|
||||
# stop and complain - so get rid of complaint
|
||||
# Ref. pv#935754
|
||||
rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long'
|
||||
_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"
|
||||
|
||||
out=$testdir/fsstress.$$.$_n
|
||||
rm -rf $out
|
||||
if ! mkdir $out
|
||||
then
|
||||
echo " failed to mkdir $out"
|
||||
status=1
|
||||
exit
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------"
|
||||
echo "fsstress.$_n : $_param"
|
||||
echo "-----------------------------------------------"
|
||||
# -m limits number of users/groups so check doesn't fail (malloc) later
|
||||
dbgoutfile=$seq.full
|
||||
if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1
|
||||
then
|
||||
echo " fsstress (count=$_count) returned $? - see $seq.full"
|
||||
echo "--------------------------------------" >>$here/$seq.full
|
||||
echo "$_n - output from fsstress:" >>$here/$seq.full
|
||||
echo "--------------------------------------" >>$here/$seq.full
|
||||
echo "<NOT LOGGED>" >>$here/$seq.full
|
||||
#cat $tmp.out >>$here/$seq.full
|
||||
status=1
|
||||
fi
|
||||
|
||||
_check_test_fs
|
||||
}
|
||||
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_setup_testdir
|
||||
|
||||
rm -f $here/$seq.full
|
||||
echo "brevity is wit..."
|
||||
|
||||
count=1000
|
||||
procs=20
|
||||
|
||||
_check_test_fs
|
||||
|
||||
# the default
|
||||
|
||||
_do_test 1 "-r" $count
|
||||
|
||||
# and the default with multiprocess
|
||||
|
||||
_do_test 2 "-p $procs -r" $count
|
||||
|
||||
# from Glen's notes
|
||||
|
||||
_do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count
|
||||
|
||||
# if all ok by here then probably don't need $seq.full
|
||||
rm -f $seq.full
|
||||
|
||||
exit
|
||||
|
||||
# Test with error injection:
|
||||
#
|
||||
# (error injection)
|
||||
# fsstress -n 1000 -d $scratch -p 4 -z -f rmdir=10 -f link=10 -f creat=10 \
|
||||
# -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 \
|
||||
# -e 1
|
||||
#
|
||||
# Error values 1 - 6 test IFLUSH
|
||||
# 1 - corrupt buffer being flushed to di_core.di_magic
|
||||
# 2 - corrupt inode being flushed i_d.di_magic
|
||||
# 3 - corrupt S_IFREG format check
|
||||
# 4 - corrupt S_IFDIR format check
|
||||
# 5 - corrupt i_d.di_nextents
|
||||
# 6 - corrupt i_d.di_forkoff > sb_inodesize
|
||||
@@ -0,0 +1,14 @@
|
||||
QA output created by 013
|
||||
brevity is wit...
|
||||
|
||||
-----------------------------------------------
|
||||
fsstress.1 : -r
|
||||
-----------------------------------------------
|
||||
|
||||
-----------------------------------------------
|
||||
fsstress.2 : -p 20 -r
|
||||
-----------------------------------------------
|
||||
|
||||
-----------------------------------------------
|
||||
fsstress.3 : -p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20
|
||||
-----------------------------------------------
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 014
|
||||
#
|
||||
# truncfile
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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/truncfile.$$.*
|
||||
_cleanup_testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_require_sparse_files
|
||||
_setup_testdir
|
||||
|
||||
# ensure EOF preallocation doesn't massively extend the runtime of this test
|
||||
# by limiting the amount of preallocation and therefore the amount of blocks
|
||||
# zeroed during the truncfile test run.
|
||||
if [ "$FSTYP" == "xfs" ]; then
|
||||
umount $TEST_DIR
|
||||
_test_mount -o allocsize=64k
|
||||
fi
|
||||
|
||||
echo "brevity is wit..."
|
||||
|
||||
echo "------"
|
||||
echo "test 1"
|
||||
echo "------"
|
||||
if ! src/truncfile -c 10000 $testdir/truncfile.$$.0 >$tmp.out 2>&1
|
||||
then
|
||||
out=`cat $tmp.out`
|
||||
echo "truncfile returned $? : \"$out\""
|
||||
else
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
exit
|
||||
@@ -0,0 +1,6 @@
|
||||
QA output created by 014
|
||||
brevity is wit...
|
||||
------
|
||||
test 1
|
||||
------
|
||||
OK
|
||||
Executable
+125
@@ -0,0 +1,125 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 015
|
||||
#
|
||||
# check out-of-space behaviour
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# 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 # success is the default!
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
umount $SCRATCH_MNT
|
||||
}
|
||||
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_free()
|
||||
{
|
||||
_df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
|
||||
}
|
||||
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_supported_os IRIX Linux
|
||||
|
||||
_require_scratch
|
||||
_require_no_large_scratch_dev
|
||||
|
||||
_scratch_mkfs_sized `expr 50 \* 1024 \* 1024` >/dev/null 2>&1 \
|
||||
|| _fail "mkfs failed"
|
||||
_scratch_mount || _fail "mount failed"
|
||||
out=$SCRATCH_MNT/fillup.$$
|
||||
rm -f $seq.full
|
||||
|
||||
free0=`_free`
|
||||
if [ -z "$free0" ]
|
||||
then
|
||||
echo " *** failed to get free space (0)"
|
||||
exit 1
|
||||
fi
|
||||
echo "free space at start $free0" >> $seq.full
|
||||
|
||||
echo "fill disk:" # well, filesystem really - not disk
|
||||
|
||||
POSIXLY_CORRECT=yes dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd
|
||||
|
||||
echo "check free space:"
|
||||
|
||||
free1=`_free`
|
||||
if [ -z "$free1" ]
|
||||
then
|
||||
echo " *** failed to get free space (1)"
|
||||
exit 1
|
||||
fi
|
||||
echo "free space after fill $free1" >> $seq.full
|
||||
|
||||
if [ ! -e $out ]
|
||||
then
|
||||
echo " *** file not created"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -s $out ]
|
||||
then
|
||||
echo " *** file created with zero length"
|
||||
ls -l $out
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "delete fill:"
|
||||
|
||||
if ! rm $out
|
||||
then
|
||||
echo " *** file not deleted"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e $out ]
|
||||
then
|
||||
echo " *** file still exists"
|
||||
ls -l $out
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "check free space:"
|
||||
|
||||
free2=`_free`
|
||||
if [ -z "$free2" ]
|
||||
then
|
||||
echo " *** failed to get free space (2)"
|
||||
exit 1
|
||||
fi
|
||||
echo "free space after delete $free2" >> $seq.full
|
||||
|
||||
echo -n " !!! "
|
||||
_within_tolerance "free space" $free2 $free0 1% -v
|
||||
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,7 @@
|
||||
QA output created by 015
|
||||
fill disk:
|
||||
!!! disk full (expected)
|
||||
check free space:
|
||||
delete fill:
|
||||
check free space:
|
||||
!!! free space is in range
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user