{
case "$FSTYP" in
nfs*)
- echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
- if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
- then
- _notrun "this test requires a valid \$SCRATCH_DEV"
- fi
+ _notrun "requires a scratch device"
;;
*)
if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
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()
{
if [ -z "$1" -o -z "$2" ]; then
_supported_fs btrfs
_supported_os Linux
-_setup_testdir
## We require scratch so that we'll have free contiguous space
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_supported_fs btrfs
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
_setup()
{
- if mkdir -p $testdir/$$
+ if mkdir -p $TEST_DIR/$$
then
:
else
- echo "Error: cannot mkdir \"$testdir/$$\""
+ echo "Error: cannot mkdir \"$TEST_DIR/$$\""
exit 1
fi
- cd $testdir/$$
+ cd $TEST_DIR/$$
$verbose && echo -n "setup "
sed -e '/^#/d' $tmp.config \
then
$verbose && echo "cleanup"
cd /
- rm -rf $testdir/$$
- _cleanup_testdir
+ rm -rf $TEST_DIR/$$
done_cleanup=true
fi
}
status=1
done_cleanup=false
-_setup_testdir
_setup
# do the test
_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
+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
do
- ln $testdir/$tmp.1 $testdir/$tmp.$l
- x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+ 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 $testdir/$tmp.1
+ 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 $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 ]
then
echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
- src/lstat64 $testdir/$tmp.1
+ src/lstat64 $TEST_DIR/$tmp.1
status=1
fi
- rm -f $testdir/$tmp.$l
+ rm -f $TEST_DIR/$tmp.$l
done
# success, all done
_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
cd /
- _cleanup_testdir
}
_touch()
_supported_os Linux IRIX
fi
-_setup_testdir
-
-cd $testdir
+cd $TEST_DIR
o=empty_file
touch $o
{
cd /
rm -f $tmp.*
- rm -rf $testdir/permname.$$
- _cleanup_testdir
+ rm -rf $TEST_DIR/permname.$$
}
_count()
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
-mkdir $testdir/permname.$$
+mkdir $TEST_DIR/permname.$$
echo ""
echo "single thread permname"
echo "----------------------"
-mkdir $testdir/permname.$$/a
-cd $testdir/permname.$$/a
+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 $testdir/permname.$$/b
-cd $testdir/permname.$$/b
+mkdir $TEST_DIR/permname.$$/b
+cd $TEST_DIR/permname.$$/b
$here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
find . | _count
{
cd /
rm -f $tmp.*
- rm -rf $testdir/$seq
- _cleanup_testdir
+ rm -rf $TEST_DIR/$seq
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
status=1 # default failure
sourcefile=$tmp.nametest
seed=1
let i=$i+1
done
-mkdir $testdir/$seq
-cd $testdir/$seq
+mkdir $TEST_DIR/$seq
+cd $TEST_DIR/$seq
$here/src/nametest -l $sourcefile -s $seed -i $iterations -z
# success, all done
{
cd /
rm -f $tmp.*
- rm -f $testdir/DBtest*.{pag,dir}
- _cleanup_testdir
+ rm -f $TEST_DIR/DBtest*.{pag,dir}
}
# filter random number output from dbtest
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
rm -f $seqres.full
-cd $testdir
+cd $TEST_DIR
$here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest
cd /
rm -f $tmp.*
[ -n "$out" ] && rm -rf $out
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
-out=$testdir/dirstress.$$
+out=$TEST_DIR/dirstress.$$
rm -f $seqres.full
# 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
+ rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long'
}
_filesize()
_param="$2"
_count="$3"
- out=$testdir/fsstress.$$.$_n
+ out=$TEST_DIR/fsstress.$$.$_n
rm -rf $out
if ! mkdir $out
then
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
rm -f $seqres.full
echo "brevity is wit..."
{
cd /
rm -f $tmp.*
- rm -rf $testdir/truncfile.$$.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/truncfile.$$.*
}
# get standard environment, filters and checks
_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
echo "------"
echo "test 1"
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
out=`cat $tmp.out`
echo "truncfile returned $? : \"$out\""
here=`pwd`
tmp=/tmp/$$
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
. ./common/rc
. ./common/filter
. ./common/attr
-_cleanup()
-{
- _cleanup_testdir
-}
-
_filter()
{
- sed "s#$testdir[^ :]*#<TESTFILE>#g;
+ sed "s#$TEST_DIR[^ :]*#<TESTFILE>#g;
s#$tmp[^ :]*#<TMPFILE>#g" $1
}
_require_attrs
-_setup_testdir
-
rm -f $seqres.full
-testfile=$testdir/attribute_$$
+testfile=$TEST_DIR/attribute_$$
echo "*** list non-existant file"
_attr_list $testfile
_cleanup()
{
cd /
- _cleanup_testdir
trap 0 1 2 3 15
exit $status
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_require_attrs
-_setup_testdir
-
FSSTRESS_ARGS=`_scale_fsstress_args \
- -d $testdir/fsstress \
+ -d $TEST_DIR/fsstress \
-f allocsp=0 \
-f freesp=0 \
-f bulkstat=0 \
_cleanup()
{
cd /
- rm -rf $testdir/fstest.$$.* $tmp.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/fstest.$$.* $tmp.*
}
# get standard environment, filters and checks
_n="$1"
_param="$2"
- out=$testdir/fstest.$$.$_n
+ out=$TEST_DIR/fstest.$$.$_n
rm -rf $out
if ! mkdir $out
then
echo "Params are for $param_type" >>$seqres.full
echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full
-_setup_testdir
-
_check_test_fs
# Options:
_cleanup()
{
cd /
- rm -rf $testdir/fsx.* $tmp.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/fsx.* $tmp.*
}
# get standard environment, filters and checks
_n="$1"
_param="$2"
- out=$testdir/fsx
+ out=$TEST_DIR/fsx
rm -rf $out
if ! mkdir $out
then
echo "Params are for $param_type" >>$seqres.full
echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
-_setup_testdir
-
rm -f $seqres.full
echo "brevity is wit..."
_cleanup()
{
- [ -n "$testdir" ] && rm -f $file
- _cleanup_testdir
+ [ -n "$TEST_DIR" ] && rm -f $file
}
_testfilter()
{
- sed -e "s#$testdir#TESTDIR#g"
+ sed -e "s#$TEST_DIR#TESTDIR#g"
}
_filefilter()
rm -f $seqres.full
-_setup_testdir
_need_to_be_root
echo "QA output created by $seq"
echo ""
-file=$testdir/$seq.file
+file=$TEST_DIR/$seq.file
user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'`
uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'`
${ATTR_PROG} -R -l $file | _filefilter
chown $uid $file
-chmod ugo+w $testdir
+chmod ugo+w $TEST_DIR
echo "as non-root call writemod"
$runas -u $uid src/writemod $file 2>&1 | _filefilter
_require_scratch
_require_attrs
-_setup_testdir
-
TARGET_DIR=$SCRATCH_MNT
[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
cd $TARGET_DIR
${ATTR_PROG} -R -l foo
cd /
-_cleanup_testdir
# Check the filesystem
_check_scratch_fs
# get dir
#export FILE_SYS=xfs
_require_scratch
-_setup_testdir
cd $TARGET_DIR
rm -rf $seq.dir1 # in case file is left over from previous runs.
# create f/s
_require_scratch
-_setup_testdir
# untar on f/s
-cd $testdir
+cd $TEST_DIR
tar -xRvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
cd $here
# use diff -qr to compare
-ls -R -l ${testdir}${POPULATED_DIR} >>$seqres.full 2>&1
-diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR}
+ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
+diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
cd /
-_cleanup_testdir
_check_scratch_fs
status=0
_cleanup()
{
cd /
- rm -rf $testdir/fsx.* $tmp.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/fsx.* $tmp.*
}
# get standard environment, filters and checks
_n="$1"
_param="$2"
- out=$testdir/fsx
+ out=$TEST_DIR/fsx
rm -rf $out
if ! mkdir $out
then
echo "Params are for $param_type" >>$seqres.full
echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
-_setup_testdir
-
rm -f $seqres.full
echo "brevity is wit..."
_cleanup()
{
cd /
- rm -f $testdir/aio-stress.$$.*
- _cleanup_testdir
+ rm -f $TEST_DIR/aio-stress.$$.*
}
# get standard environment, filters and checks
_count="$3"
_nproc="$4"
- _files="$testdir/aiostress.$$.$_n"
+ _files="$TEST_DIR/aiostress.$$.$_n"
__proc=$_nproc
[ $__proc -gt 1 ] && _param="-t $__proc $_param"
while [ $__proc -gt 1 ]; do
- _files="$_files $testdir/aiostress.$$.$_n.$__proc"
+ _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
let __proc=$__proc-1
done
rm -f $_files
[ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
-_setup_testdir
-
echo "brevity is wit..."
count=1000
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
_require_scratch
_require_attrs
_cleanup()
{
- cd $testdir
+ cd $TEST_DIR
rm -rf $my_test_subdir
cd /
- _cleanup_testdir
}
# get standard environment, filters and checks
_require_user
-_setup_testdir
-my_test_subdir=$testdir/123subdir
+my_test_subdir=$TEST_DIR/123subdir
# create subdir with required permissions
mkdir -m 755 $my_test_subdir
_cleanup()
{
cd /
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
# Run preallo_rw_pattern on both test and scratch partitions
-for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
+for TESTFILE in $TEST_DIR/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
do
count=1
while (( count < 101 ))
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_require_user
-_setup_testdir
-
-TESTDIR=$testdir/ftrunc
+TESTDIR=$TEST_DIR/ftrunc
TESTFILE=$TESTDIR/ftrunc.tmp
[ -d $TESTDIR ] && rm -r $TESTDIR
_cleanup()
{
cd /
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os Linux
-_setup_testdir
-
QA_FS_PERMS=$here/src/fs_perms
-cd $testdir
+cd $TEST_DIR
cp $here/src/testx ./testx.file
# file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
_cleanup()
{
rm -f $tmp.output
- _cleanup_testdir
}
# get standard environment, filters and checks
_fsx_lite_nommap()
{
echo "=== FSX Light Mode, No Memory Mapping ==="
- dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
- if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
+ dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+ if ! ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
then
- echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
+ echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
cat $tmp.output
return 1
fi
_fsx_lite_mmap()
{
echo "=== FSX Light Mode, Memory Mapping ==="
- dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
- if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
+ dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+ if ! ltp/fsx $FSX_ARGS -L $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
then
echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
cat $tmp.output
_fsx_std_nommap()
{
echo "=== FSX Standard Mode, No Memory Mapping ==="
- if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
+ if ! ltp/fsx $FSX_ARGS -R -W $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
then
echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
cat $tmp.output
_fsx_std_mmap()
{
echo "=== FSX Standard Mode, Memory Mapping ==="
- if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
+ if ! ltp/fsx $FSX_ARGS $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
then
echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
cat $tmp.output
_supported_fs generic
_supported_os Linux
-_setup_testdir
-
_fsx_lite_nommap
_fsx_lite_mmap
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs generic
_supported_os Linux
-_setup_testdir
_require_scratch
_require_user
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_require_scratch
_require_sparse_files
-_setup_testdir
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount "-o nosuid"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_require_scratch
_require_sparse_files
-_setup_testdir
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
{
kill $locktest_pid2 > /dev/null 2>&1
kill $locktest_pid1 > /dev/null 2>&1
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os Linux
-_setup_testdir
-
-TESTFILE=$testdir/lock_file
+TESTFILE=$TEST_DIR/lock_file
# Grab a port which is hopefully unused
if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
fi
# Start the server
-src/locktest -p $PORT $TESTFILE 2>&1 > $testdir/server.out &
+src/locktest -p $PORT $TESTFILE 2>&1 > $TEST_DIR/server.out &
locktest_pid1=$!
sleep 1
# Start the client
-src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $testdir/client.out
+src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $TEST_DIR/client.out
locktest_pid2=$!
result=$?
if [ $result -eq 0 ]; then
status=0
else
echo "Client reported failure ($result)"
- cat $testdir/*.out
+ cat $TEST_DIR/*.out
fi
exit
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs generic
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs generic
_supported_os Linux IRIX
-_setup_testdir
-
echo "Buffered writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
echo "Direct writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
echo "Buffered writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
echo "Direct writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
status=0
exit
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs generic
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs generic
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs generic
_supported_os IRIX Linux
-_setup_testdir
-
-rm -f $testdir/null
-mknod $testdir/null c 1 3
-chmod 666 $testdir/null
-echo fred > $testdir/null
+rm -f $TEST_DIR/null
+mknod $TEST_DIR/null c 1 3
+chmod 666 $TEST_DIR/null
+echo fred > $TEST_DIR/null
status=$?
exit
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
{
cd /
rm -f $tmp.*
- [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
- _cleanup_testdir
+ [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
}
# real QA test starts here
rm -f $seqres.full
-_setup_testdir
-
_need_to_be_root
_acl_setup_ids
_require_acls
# get dir
-cd $testdir
+cd $TEST_DIR
rm -rf $seq.dir1
mkdir $seq.dir1
cd $seq.dir1
cd /
rm -f $tmp.*
rm -f $SRC $DST
- _cleanup_testdir
}
# get standard environment, filters and checks
# real QA test starts here
_supported_fs generic
_supported_os Linux
-_setup_testdir
echo "Feel the serenity."
{
cd /
rm -f $tmp.*
- [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
- _cleanup_testdir
+ [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
}
# -----
rm -f $seqres.full
-_setup_testdir
-
_need_to_be_root
_acl_setup_ids
_require_acls
# get dir
-cd $testdir
+cd $TEST_DIR
rm -rf $seq.dir1
mkdir $seq.dir1
cd $seq.dir1
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs xfs ext4 btrfs
_supported_os Linux
-_setup_testdir
# We require scratch so that we'll have free contiguous space
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_require_scratch
_require_attrs
-_setup_testdir
-
cd $SCRATCH_MNT
echo "create file foo"
{
rm -f $tmp.*
cd /
- _cleanup_testdir
}
# get standard environment, filters and checks
. ./common/rc
_cleanup()
{
rm -f $tmp.*
- rm -rf $testdir/randholes.$$.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/randholes.$$.*
}
_filter()
_holes="$2"
_param="$3"
- out=$testdir/randholes.$$.$_n
+ out=$TEST_DIR/randholes.$$.$_n
echo ""
echo "randholes.$_n : $_param" | _filter
echo "------------------------------------------"
_supported_fs xfs
_supported_os IRIX Linux
-_setup_testdir
-
rm -f $seqres.full
# Note on special numbers here.
{
cd /
rm -f $tmp.*
- rm -rf $testdir/holes.$$.*
- _cleanup_testdir
+ rm -rf $TEST_DIR/holes.$$.*
}
_filesize()
failed=0
- out=$testdir/holes.$$.$_n
+ out=$TEST_DIR/holes.$$.$_n
echo ""
echo "holes.$_n : $_param"
echo "-----------------------------------------------"
_supported_fs xfs
_supported_os IRIX Linux
-_setup_testdir
-
rm -f $seqres.full
# small & fairly dense
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
-_setup_testdir
-
-src/fault $testdir || exit
+src/fault $TEST_DIR || exit
# success, all done
status=0
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
-_setup_testdir
-
_my_stat_filter()
{
grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
}
-rm -f $testdir/testfile
-if src/feature -t $testdir/testfile; then
+rm -f $TEST_DIR/testfile
+if src/feature -t $TEST_DIR/testfile; then
:
else
_notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
rm -f $tmp.*
umount -d $LOOP_MNT 2>/dev/null
rmdir $LOOP_MNT
- _cleanup_testdir
}
# get standard environment, filters and checks
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
_supported_fs xfs
# but not at the moment.
_supported_os Linux
-_setup_testdir
-
quiet=-q
clean=-c
export here
-cd $testdir
+cd $TEST_DIR
echo
# real QA test starts here
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_report_filter () {
$PERL_PROG -ne "s/Report: \"0x[0-f]+\" was written and \"0x[0-f]+\" was read at/Report: \"HEX\" was written and \"HEX\" was read at/g ;
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_filter_fs_handle()
{
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_dm_create_session()
{
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_filter_handles()
{
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_filter_get_allocinfo()
{
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_filter_paths()
{
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+trap "exit \$status" 0 1 2 3 15
rm -f $seqres.full
-_cleanup()
-{
- _cleanup_testdir
-}
-
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
_supported_fs xfs
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
{
$KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
sync # ensures all fsstress processes died
- _cleanup_testdir
}
workout()
[ -n "$KILLALL_PROG" ] || _notrun "killall executable not found"
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
tmp=/tmp/$$
rm -f $seqres.full
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
_filter_dmapi_print_event() {
$PERL_PROG -ne '
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
_supported_fs xfs
_supported_os Linux IRIX
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs xfs
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
{
cd /
rm -f $tmp.*
- _cleanup_testdir
}
# get standard environment, filters and checks
_supported_fs xfs
_supported_os Linux
-_setup_testdir
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
umount -d $LOOP_MNT 2>/dev/null
rm -f $LOOP_DEV
rmdir $LOOP_MNT
- _cleanup_testdir
}
# get standard environment, filters and checks