xfstests: stop special casing nfs and udf

For historical reasons beyond my knowledge xfstests tries to abuse the
scratch device as test device for nfs and udf.  Because not all test
have inherited the right usage of the _setup_testdir and _cleanup_testdir
helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of
failures.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Sugned-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Christoph Hellwig
2013-12-03 10:29:26 +11:00
committed by Dave Chinner
parent 10298d30e5
commit c041421687
85 changed files with 137 additions and 563 deletions
+1 -99
View File
@@ -975,11 +975,7 @@ _require_scratch()
{ {
case "$FSTYP" in case "$FSTYP" in
nfs*) nfs*)
echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 _notrun "requires a scratch device"
if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
then
_notrun "this test requires a valid \$SCRATCH_DEV"
fi
;; ;;
*) *)
if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ] if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
@@ -1773,100 +1769,6 @@ _full_platform_details()
echo "$os/$platform $host $kernel" echo "$os/$platform $host $kernel"
} }
_setup_udf_scratchdir()
{
[ "$FSTYP" != "udf" ] \
&& _fail "setup_udf_testdir: \$FSTYP is not udf"
[ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
&& _notrun "this test requires a valid \$SCRATCH_DEV"
[ -z "$SCRATCH_MNT" ] \
&& _notrun "this test requires a valid \$SCRATCH_MNT"
# mounted?
if _mount | grep -q $SCRATCH_DEV
then
# if it's mounted, make sure its on $TEST_RW_DIR
if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
then
_fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
fi
$UMOUNT_PROG $SCRATCH_DEV
fi
_scratch_mkfs
_scratch_mount
testdir=$SCRATCH_MNT
}
_setup_nfs_scratchdir()
{
[ "$FSTYP" != "nfs" ] \
&& _fail "setup_nfs_testdir: \$FSTYP is not nfs"
[ -z "$SCRATCH_DEV" ] \
&& _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
[ -z "$SCRATCH_MNT" ] \
&& _notrun "this test requires a valid \$SCRATCH_MNT"
# mounted?
if _mount | grep -q $SCRATCH_DEV
then
# if it's mounted, make sure its on $SCRATCH_MNT
if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
then
_fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
fi
$UMOUNT_PROG $SCRATCH_DEV
fi
_scratch_mkfs
_scratch_mount
testdir=$SCRATCH_MNT
}
#
# Warning for UDF and NFS:
# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
# which actually uses the scratch dir for the test dir.
#
# This was done because testdir was intended to be a persistent
# XFS only partition. This should eventually change, and treat
# at least local filesystems all the same.
#
_setup_testdir()
{
case $FSTYP in
udf)
_setup_udf_scratchdir
;;
nfs*)
_setup_nfs_scratchdir
;;
*)
testdir=$TEST_DIR
;;
esac
}
_cleanup_testdir()
{
case $FSTYP in
udf)
# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
[ -n "$testdir" ] && $UMOUNT_PROG $testdir
;;
nfs*)
# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
[ -n "$testdir" ] && $UMOUNT_PROG $testdir
;;
*)
# do nothing, testdir is $TEST_DIR
:
;;
esac
}
_link_out_file() _link_out_file()
{ {
if [ -z "$1" -o -z "$2" ]; then if [ -z "$1" -o -z "$2" ]; then
-1
View File
@@ -135,7 +135,6 @@ _rundefrag()
_supported_fs btrfs _supported_fs btrfs
_supported_os Linux _supported_os Linux
_setup_testdir
## We require scratch so that we'll have free contiguous space ## We require scratch so that we'll have free contiguous space
_require_scratch _require_scratch
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
-1
View File
@@ -54,7 +54,6 @@ _balance()
_supported_fs btrfs _supported_fs btrfs
_supported_os Linux _supported_os Linux
_setup_testdir
_require_scratch _require_scratch
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_scratch_mount _scratch_mount
+4 -6
View File
@@ -118,14 +118,14 @@ udf_fsize=20240 # number of sectors for UDF
_setup() _setup()
{ {
if mkdir -p $testdir/$$ if mkdir -p $TEST_DIR/$$
then then
: :
else else
echo "Error: cannot mkdir \"$testdir/$$\"" echo "Error: cannot mkdir \"$TEST_DIR/$$\""
exit 1 exit 1
fi fi
cd $testdir/$$ cd $TEST_DIR/$$
$verbose && echo -n "setup " $verbose && echo -n "setup "
sed -e '/^#/d' $tmp.config \ sed -e '/^#/d' $tmp.config \
@@ -286,8 +286,7 @@ _cleanup()
then then
$verbose && echo "cleanup" $verbose && echo "cleanup"
cd / cd /
rm -rf $testdir/$$ rm -rf $TEST_DIR/$$
_cleanup_testdir
done_cleanup=true done_cleanup=true
fi fi
} }
@@ -298,7 +297,6 @@ _cleanup
status=1 status=1
done_cleanup=false done_cleanup=false
_setup_testdir
_setup _setup
# do the test # do the test
+8 -11
View File
@@ -38,43 +38,40 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
rm -f $tmp.* rm -f $tmp.*
_cleanup_testdir
} }
# real QA test starts here # real QA test starts here
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir
echo "Silence is goodness ..." echo "Silence is goodness ..."
# ensure target directory exists # ensure target directory exists
mkdir `dirname $testdir/$tmp` 2>/dev/null mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
touch $testdir/$tmp.1 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 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do do
ln $testdir/$tmp.1 $testdir/$tmp.$l ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
if [ "$l" -ne $x ] if [ "$l" -ne $x ]
then then
echo "Arrgh, created link #$l and lstat64 looks like ..." echo "Arrgh, created link #$l and lstat64 looks like ..."
src/lstat64 $testdir/$tmp.1 src/lstat64 $TEST_DIR/$tmp.1
status=1 status=1
fi fi
done done
for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
do do
x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
if [ "$l" -ne $x ] if [ "$l" -ne $x ]
then then
echo "Arrgh, about to remove link #$l and lstat64 looks like ..." echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
src/lstat64 $testdir/$tmp.1 src/lstat64 $TEST_DIR/$tmp.1
status=1 status=1
fi fi
rm -f $testdir/$tmp.$l rm -f $TEST_DIR/$tmp.$l
done done
# success, all done # success, all done
+2 -5
View File
@@ -43,10 +43,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
cd $testdir cd $TEST_DIR
rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
cd / cd /
_cleanup_testdir
} }
_touch() _touch()
@@ -75,9 +74,7 @@ else
_supported_os Linux IRIX _supported_os Linux IRIX
fi fi
_setup_testdir cd $TEST_DIR
cd $testdir
o=empty_file o=empty_file
touch $o touch $o
+6 -9
View File
@@ -35,8 +35,7 @@ _cleanup()
{ {
cd / cd /
rm -f $tmp.* rm -f $tmp.*
rm -rf $testdir/permname.$$ rm -rf $TEST_DIR/permname.$$
_cleanup_testdir
} }
_count() _count()
@@ -56,23 +55,21 @@ _count()
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir mkdir $TEST_DIR/permname.$$
mkdir $testdir/permname.$$
echo "" echo ""
echo "single thread permname" echo "single thread permname"
echo "----------------------" echo "----------------------"
mkdir $testdir/permname.$$/a mkdir $TEST_DIR/permname.$$/a
cd $testdir/permname.$$/a cd $TEST_DIR/permname.$$/a
$here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?" $here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
find . | _count find . | _count
echo "" echo ""
echo "multi thread permname" echo "multi thread permname"
echo "----------------------" echo "----------------------"
mkdir $testdir/permname.$$/b mkdir $TEST_DIR/permname.$$/b
cd $testdir/permname.$$/b cd $TEST_DIR/permname.$$/b
$here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?" $here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
find . | _count find . | _count
+3 -6
View File
@@ -38,8 +38,7 @@ _cleanup()
{ {
cd / cd /
rm -f $tmp.* rm -f $tmp.*
rm -rf $testdir/$seq rm -rf $TEST_DIR/$seq
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -50,8 +49,6 @@ _cleanup()
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir
status=1 # default failure status=1 # default failure
sourcefile=$tmp.nametest sourcefile=$tmp.nametest
seed=1 seed=1
@@ -66,8 +63,8 @@ while [ $i -le $num_filenames ]; do
let i=$i+1 let i=$i+1
done done
mkdir $testdir/$seq mkdir $TEST_DIR/$seq
cd $testdir/$seq cd $TEST_DIR/$seq
$here/src/nametest -l $sourcefile -s $seed -i $iterations -z $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
# success, all done # success, all done
+2 -5
View File
@@ -35,8 +35,7 @@ _cleanup()
{ {
cd / cd /
rm -f $tmp.* rm -f $tmp.*
rm -f $testdir/DBtest*.{pag,dir} rm -f $TEST_DIR/DBtest*.{pag,dir}
_cleanup_testdir
} }
# filter random number output from dbtest # filter random number output from dbtest
@@ -58,11 +57,9 @@ _filter_dbtest()
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir
rm -f $seqres.full rm -f $seqres.full
cd $testdir cd $TEST_DIR
$here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest $here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest
+1 -4
View File
@@ -37,7 +37,6 @@ _cleanup()
cd / cd /
rm -f $tmp.* rm -f $tmp.*
[ -n "$out" ] && rm -rf $out [ -n "$out" ] && rm -rf $out
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -48,9 +47,7 @@ _cleanup()
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir out=$TEST_DIR/dirstress.$$
out=$testdir/dirstress.$$
rm -f $seqres.full rm -f $seqres.full
+2 -5
View File
@@ -41,8 +41,7 @@ _cleanup()
# such that what it has is greater the 1024 chars and will # such that what it has is greater the 1024 chars and will
# stop and complain - so get rid of complaint # stop and complain - so get rid of complaint
# Ref. pv#935754 # Ref. pv#935754
rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long' rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long'
_cleanup_testdir
} }
_filesize() _filesize()
@@ -60,7 +59,7 @@ _do_test()
_param="$2" _param="$2"
_count="$3" _count="$3"
out=$testdir/fsstress.$$.$_n out=$TEST_DIR/fsstress.$$.$_n
rm -rf $out rm -rf $out
if ! mkdir $out if ! mkdir $out
then then
@@ -93,8 +92,6 @@ _do_test()
_supported_fs generic _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_setup_testdir
rm -f $seqres.full rm -f $seqres.full
echo "brevity is wit..." echo "brevity is wit..."
+2 -4
View File
@@ -35,8 +35,7 @@ _cleanup()
{ {
cd / cd /
rm -f $tmp.* rm -f $tmp.*
rm -rf $testdir/truncfile.$$.* rm -rf $TEST_DIR/truncfile.$$.*
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -47,7 +46,6 @@ _supported_fs generic
_supported_os IRIX Linux _supported_os IRIX Linux
_require_sparse_files _require_sparse_files
_setup_testdir
# ensure EOF preallocation doesn't massively extend the runtime of this test # ensure EOF preallocation doesn't massively extend the runtime of this test
# by limiting the amount of preallocation and therefore the amount of blocks # by limiting the amount of preallocation and therefore the amount of blocks
@@ -62,7 +60,7 @@ echo "brevity is wit..."
echo "------" echo "------"
echo "test 1" echo "test 1"
echo "------" echo "------"
if ! src/truncfile -c 10000 $testdir/truncfile.$$.0 >$tmp.out 2>&1 if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
then then
out=`cat $tmp.out` out=`cat $tmp.out`
echo "truncfile returned $? : \"$out\"" echo "truncfile returned $? : \"$out\""
+3 -10
View File
@@ -29,21 +29,16 @@ echo "QA output created by $seq"
here=`pwd` here=`pwd`
tmp=/tmp/$$ tmp=/tmp/$$
status=0 # success is the default! status=0 # success is the default!
trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15 trap "rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks # get standard environment, filters and checks
. ./common/rc . ./common/rc
. ./common/filter . ./common/filter
. ./common/attr . ./common/attr
_cleanup()
{
_cleanup_testdir
}
_filter() _filter()
{ {
sed "s#$testdir[^ :]*#<TESTFILE>#g; sed "s#$TEST_DIR[^ :]*#<TESTFILE>#g;
s#$tmp[^ :]*#<TMPFILE>#g" $1 s#$tmp[^ :]*#<TMPFILE>#g" $1
} }
@@ -83,11 +78,9 @@ _supported_os Linux
_require_attrs _require_attrs
_setup_testdir
rm -f $seqres.full rm -f $seqres.full
testfile=$testdir/attribute_$$ testfile=$TEST_DIR/attribute_$$
echo "*** list non-existant file" echo "*** list non-existant file"
_attr_list $testfile _attr_list $testfile
-1
View File
@@ -36,7 +36,6 @@ ITERATIONS=10
_cleanup() _cleanup()
{ {
cd / cd /
_cleanup_testdir
trap 0 1 2 3 15 trap 0 1 2 3 15
exit $status exit $status
+1 -4
View File
@@ -35,7 +35,6 @@ _cleanup()
{ {
cd / cd /
rm -f $tmp.* rm -f $tmp.*
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -49,10 +48,8 @@ _supported_os IRIX Linux
_require_attrs _require_attrs
_setup_testdir
FSSTRESS_ARGS=`_scale_fsstress_args \ FSSTRESS_ARGS=`_scale_fsstress_args \
-d $testdir/fsstress \ -d $TEST_DIR/fsstress \
-f allocsp=0 \ -f allocsp=0 \
-f freesp=0 \ -f freesp=0 \
-f bulkstat=0 \ -f bulkstat=0 \
+2 -5
View File
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
cd / cd /
rm -rf $testdir/fstest.$$.* $tmp.* rm -rf $TEST_DIR/fstest.$$.* $tmp.*
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
_n="$1" _n="$1"
_param="$2" _param="$2"
out=$testdir/fstest.$$.$_n out=$TEST_DIR/fstest.$$.$_n
rm -rf $out rm -rf $out
if ! mkdir $out if ! mkdir $out
then then
@@ -156,8 +155,6 @@ _process_args "$@"
echo "Params are for $param_type" >>$seqres.full echo "Params are for $param_type" >>$seqres.full
echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full
_setup_testdir
_check_test_fs _check_test_fs
# Options: # Options:
+2 -5
View File
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
cd / cd /
rm -rf $testdir/fsx.* $tmp.* rm -rf $TEST_DIR/fsx.* $tmp.*
_cleanup_testdir
} }
# get standard environment, filters and checks # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
_n="$1" _n="$1"
_param="$2" _param="$2"
out=$testdir/fsx out=$TEST_DIR/fsx
rm -rf $out rm -rf $out
if ! mkdir $out if ! mkdir $out
then then
@@ -136,8 +135,6 @@ _process_args "$@"
echo "Params are for $param_type" >>$seqres.full echo "Params are for $param_type" >>$seqres.full
echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
_setup_testdir
rm -f $seqres.full rm -f $seqres.full
echo "brevity is wit..." echo "brevity is wit..."
+4 -6
View File
@@ -41,13 +41,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
[ -n "$testdir" ] && rm -f $file [ -n "$TEST_DIR" ] && rm -f $file
_cleanup_testdir
} }
_testfilter() _testfilter()
{ {
sed -e "s#$testdir#TESTDIR#g" sed -e "s#$TEST_DIR#TESTDIR#g"
} }
_filefilter() _filefilter()
@@ -65,12 +64,11 @@ _require_attrs
rm -f $seqres.full rm -f $seqres.full
_setup_testdir
_need_to_be_root _need_to_be_root
echo "QA output created by $seq" echo "QA output created by $seq"
echo "" echo ""
file=$testdir/$seq.file file=$TEST_DIR/$seq.file
user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'` user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'`
uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'` uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'`
@@ -149,7 +147,7 @@ echo "list EA on file"
${ATTR_PROG} -R -l $file | _filefilter ${ATTR_PROG} -R -l $file | _filefilter
chown $uid $file chown $uid $file
chmod ugo+w $testdir chmod ugo+w $TEST_DIR
echo "as non-root call writemod" echo "as non-root call writemod"
$runas -u $uid src/writemod $file 2>&1 | _filefilter $runas -u $uid src/writemod $file 2>&1 | _filefilter
-3
View File
@@ -78,8 +78,6 @@ _supported_os IRIX
_require_scratch _require_scratch
_require_attrs _require_attrs
_setup_testdir
TARGET_DIR=$SCRATCH_MNT TARGET_DIR=$SCRATCH_MNT
[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
cd $TARGET_DIR cd $TARGET_DIR
@@ -245,7 +243,6 @@ echo "list root EAs: none"
${ATTR_PROG} -R -l foo ${ATTR_PROG} -R -l foo
cd / cd /
_cleanup_testdir
# Check the filesystem # Check the filesystem
_check_scratch_fs _check_scratch_fs
-1
View File
@@ -88,7 +88,6 @@ _require_acls
# get dir # get dir
#export FILE_SYS=xfs #export FILE_SYS=xfs
_require_scratch _require_scratch
_setup_testdir
cd $TARGET_DIR cd $TARGET_DIR
rm -rf $seq.dir1 # in case file is left over from previous runs. rm -rf $seq.dir1 # in case file is left over from previous runs.

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