local set_encpolicy_args=$4
local keydesc=$5
local raw_key_hex=$6
- local crypt_cmd="src/fscrypt-crypt-util $7"
+ local crypt_cmd="$here/src/fscrypt-crypt-util $7"
local blocksize=$(_get_block_size $SCRATCH_MNT)
local test_contents_files=()
touch $TESTFILE
# Start the server
- src/locktest $mode $TESTFILE 2> $SERVER_LOG 1> $SERVER_PORT &
+ $here/src/locktest $mode $TESTFILE 2> $SERVER_LOG 1> $SERVER_PORT &
server_pid=$!
timeout=30
# Start the client
- src/locktest $mode -p $PORT -h localhost $TESTFILE 2> $CLIENT_LOG
+ $here/src/locktest $mode -p $PORT -h localhost $TESTFILE 2> $CLIENT_LOG
client_result=$?
client_pid=$!
if [ $client_result -ne 0 ]; then
__populate_fragment_file() {
local fname="$1"
- test -f "${fname}" && ./src/punch-alternating "${fname}"
+ test -f "${fname}" && $here/src/punch-alternating "${fname}"
}
# Create a large directory
#
_require_xfs_quota()
{
- src/feature -q $TEST_DEV
+ $here/src/feature -q $TEST_DEV
[ $? -ne 0 ] && _notrun "Installed kernel does not support XFS quota"
if [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ]; then
_notrun "Quotas not supported on realtime test device"
[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
return
fi
- src/feature -P $_dev
+ $here/src/feature -P $_dev
[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
if [ "$USE_EXTERNAL" = yes ]; then
if [ -n "$TEST_RTDEV" -o -n "$SCRATCH_RTDEV" ]; then
local testfile=$dir/$$.ftype
touch $testfile
# look for DT_UNKNOWN files
- local unknowns=$(src/t_dir_type $dir u | wc -l)
+ local unknowns=$($here/src/t_dir_type $dir u | wc -l)
rm $testfile
# 0 unknowns is success
return $unknowns
if [ -z $OVL_BASE_SCRATCH_DEV ]; then
_fail "_scratch_shutdown: call _require_scratch_shutdown first in test"
else
- src/godown $* $OVL_BASE_SCRATCH_MNT
+ $here/src/godown $* $OVL_BASE_SCRATCH_MNT
fi
else
- src/godown $* $SCRATCH_MNT
+ $here/src/godown $* $SCRATCH_MNT
fi
}
fi
if [ -b "$dev" ]; then
- src/lstat64 "$dev" | $AWK_PROG '/Device type:/ { print $9 }'
+ $here/src/lstat64 "$dev" | $AWK_PROG '/Device type:/ { print $9 }'
fi
}
fi
if [ -c "$dev" ]; then
- src/lstat64 "$dev" | $AWK_PROG '/Device type:/ { print $9 }'
+ $here/src/lstat64 "$dev" | $AWK_PROG '/Device type:/ { print $9 }'
fi
}
{
if [ -z "$1" ]
then
- AIO_TEST=src/aio-dio-regress/aiodio_sparse2
+ AIO_TEST=$here/src/aio-dio-regress/aiodio_sparse2
[ -x $AIO_TEST ] || _notrun "aio-dio utilities required"
else
- AIO_TEST=src/aio-dio-regress/$1
+ AIO_TEST=$here/src/aio-dio-regress/$1
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
fi
_require_aio
#
_require_test_program()
{
- local prog=src/$1
+ local prog=$here/src/$1
[ -x $prog ] || _notrun "$prog not built"
}
# Does shutdown work on this fs?
_require_scratch_shutdown()
{
- [ -x src/godown ] || _notrun "src/godown executable not found"
+ [ -x $here/src/godown ] || _notrun "src/godown executable not found"
_scratch_mkfs > /dev/null 2>&1 || _notrun "_scratch_mkfs failed on $SCRATCH_DEV"
_scratch_mount
# running shutdown to avoid shutting down base fs accidently.
_notrun "This test requires a valid $OVL_BASE_SCRATCH_DEV as ovl base fs"
else
- src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \
+ $here/src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \
|| _notrun "Underlying filesystem does not support shutdown"
fi
else
- src/godown -f $SCRATCH_MNT 2>&1 \
+ $here/src/godown -f $SCRATCH_MNT 2>&1 \
|| _notrun "$FSTYP does not support shutdown"
fi
_require_userns()
{
- [ -x src/nsexec ] || _notrun "src/nsexec executable not found"
- src/nsexec -U true 2>/dev/null || _notrun "userns not supported by this kernel"
+ [ -x $here/src/nsexec ] || _notrun "src/nsexec executable not found"
+ $here/src/nsexec -U true 2>/dev/null || _notrun "userns not supported by this kernel"
}
_create_loop_device()
# EINVAL will be returned.
_require_test_program "t_ofd_locks"
touch $TEST_DIR/ofd_testfile
- src/t_ofd_locks -t $TEST_DIR/ofd_testfile > /dev/null 2>&1
+ $here/src/t_ofd_locks -t $TEST_DIR/ofd_testfile > /dev/null 2>&1
[ $? -eq 22 ] && _notrun "Require OFD locks support"
}
echo -n "$options $stype/$dtype -> "
_setup_one $source $stype
_setup_one $dest $dtype
- src/renameat2 $source $dest $flags
+ $here/src/renameat2 $source $dest $flags
if test $? == 0; then
_showtype_one $source
echo -n "/"
local rename_dir=$TEST_DIR/$$
local cmd=""
- if test ! -x src/renameat2; then
+ if test ! -x $here/src/renameat2; then
_notrun "renameat2 binary not found"
fi
_fail "_require_renameat2: only support noreplace,exchange,whiteout rename flags"
;;
esac
- if ! src/renameat2 -t $cmd; then
+ if ! $here/src/renameat2 -t $cmd; then
rm -rf $rename_dir
_notrun "kernel doesn't support renameat2 syscall"
fi
exit
fi
length=`expr $length / 512`
- src/devzero -v $value -b 1 -n $length -o $offset $SCRATCH_DEV \
+ $here/src/devzero -v $value -b 1 -n $length -o $offset $SCRATCH_DEV \
| perl -npe 's/\d\.\d\dKb/X.XXKb/g'
}
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'`
+ x=`$here/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
+ $here/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'`
+ x=`$here/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
+ $here/src/lstat64 $TEST_DIR/$tmp.1
status=1
fi
rm -f $TEST_DIR/$tmp.$l
echo "------"
echo "test 1"
echo "------"
-src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
+$here/src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
ret=$?
if [ "$ret" -ne 0 ]; then
out=`cat $tmp.out`
file2=$rename_dir/file2
touch $file1
touch $file2
-src/t_rename_overwrite $file1 $file2
+$here/src/t_rename_overwrite $file1 $file2
rm $file2
echo "overwriting directory:"
dir2=$rename_dir/dir2
mkdir $dir1
mkdir $dir2
-src/t_rename_overwrite $dir1 $dir2
+$here/src/t_rename_overwrite $dir1 $dir2
rmdir $dir2
rmdir $rename_dir
# write, run the test command and shutdown the fs
$XFS_IO_PROG -f -c "pwrite -S 1 0 64k" -c "$cmd 60k 4k" $file | \
_filter_xfs_io
- ./src/godown -f $mnt
+ $here/src/godown -f $mnt
$UMOUNT_PROG $mnt
_mount $img $mnt
procs=2
while [ -f "$tmp.running" ]
do
- src/fstest -m -p $FSTEST_DIR -n $procs -f 4 > /dev/null 2>&1
+ $here/src/fstest -m -p $FSTEST_DIR -n $procs -f 4 > /dev/null 2>&1
done
rm -rf $FSTEST_DIR/*
_scratch_mount
# create, open & unlinked files so unlinked inode list is not empty
-src/multi_open_unlink -f $SCRATCH_MNT/$seq.unlinked -n $nr_cpu &
+$here/src/multi_open_unlink -f $SCRATCH_MNT/$seq.unlinked -n $nr_cpu &
open_pid=$!
# start link/unlink storm
_require_test
path=$TEST_DIR/t_access
-src/t_access_root $path | tee $seqres.full | _filter
+$here/src/t_access_root $path | tee $seqres.full | _filter
# success, all done
status=0
touch $file
chown $qa_user $file
chmod ugo+w $TEST_DIR
+# don't use $here/src/writemod, as we're running it as a regular user, and
+# $here may contain path component that a regular user doesn't have search
+# permission
su $qa_user -c "src/writemod $file" | filefilter
cat $file
_compare_access_times()
{
original_access_time="`cat $tmp.out | sed -n '5p'|awk '{ print substr($0,0,32)}'`"
- accessed_time="`src/lstat64 $1 | sed -n '5p'| awk '{ print substr($0,0,32)}'`"
+ accessed_time="`$here/src/lstat64 $1 | sed -n '5p'| awk '{ print substr($0,0,32)}'`"
echo "*** compare access times ***"
if [ "$original_access_time" != "$accessed_time" ]
then
echo "*** file access time updated on $2 (unexpected) ***"
cat $tmp.out
echo "---------------------------------------------------"
- src/lstat64 $1
+ $here/src/lstat64 $1
mount | grep $SCRATCH_MNT
fi
#executable file
echo "*** copying file ***"
-cp src/lstat64 $SCRATCH_MNT
-src/lstat64 $SCRATCH_MNT/lstat64 >$tmp.out
+cp $here/src/lstat64 $SCRATCH_MNT
+$here/src/lstat64 $SCRATCH_MNT/lstat64 >$tmp.out
sleep 5
echo "*** executing file ***"
$SCRATCH_MNT/lstat64 $SCRATCH_MNT/lstat64 >/dev/null
#reading file
echo "*** creating file ***"
touch $SCRATCH_MNT/testfile
-src/lstat64 $SCRATCH_MNT/testfile >$tmp.out
+$here/src/lstat64 $SCRATCH_MNT/testfile >$tmp.out
sleep 5
echo "*** reading file ***"
cat $SCRATCH_MNT/testfile >/dev/null
#writing file
echo "*** creating file ***"
touch $SCRATCH_MNT/testfile2
-src/lstat64 $SCRATCH_MNT/testfile2 >$tmp.out
+$here/src/lstat64 $SCRATCH_MNT/testfile2 >$tmp.out
sleep 5
echo "*** writing to file ***"
echo "asdf" >> $SCRATCH_MNT/testfile2
count=1
while (( count < 101 ))
do
- src/preallo_rw_pattern_writer $TESTFILE
- src/preallo_rw_pattern_reader $TESTFILE
+ $here/src/preallo_rw_pattern_writer $TESTFILE
+ $here/src/preallo_rw_pattern_reader $TESTFILE
if (test $? -ne 0) then
echo Read/Write Pattern Test FAILED.
_cleanup
chmod a+rw $TESTDIR
chmod a+rw $TESTFILE
+# don't use $here/src/ftrunc, as we're running it as a regular user, and $here
+# may contain path component that a regular user doesn't have search permission
su $qa_user -c "./src/ftrunc -f $TESTFILE"
if [ "$?" != "0" ]; then
echo src/ftrunc returned non 0 status!
fi
-src/trunc -f $TESTFILE
+$here/src/trunc -f $TESTFILE
if (test $? -eq 0 ) then
status=0
fi
mkdir $SCRATCH_MNT/looptest
-src/looptest -i 100000 -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest1.tst
-src/looptest -i 10000 -t -r -w -s -b 102400 $SCRATCH_MNT/looptest/looptest2.tst
-src/looptest -i 50000 -r -w -b 256 -s $SCRATCH_MNT/looptest/looptest3.tst
-src/looptest -i 2000 -o -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest4.tst
+$here/src/looptest -i 100000 -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest1.tst
+$here/src/looptest -i 10000 -t -r -w -s -b 102400 $SCRATCH_MNT/looptest/looptest2.tst
+$here/src/looptest -i 50000 -r -w -b 256 -s $SCRATCH_MNT/looptest/looptest3.tst
+$here/src/looptest -i 2000 -o -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest4.tst
status=0
exit
$XFS_IO_PROG -f -c "pwrite -b $SIZE 0 $SIZE" \
$SCRATCH_MNT/file-$FILE-$SIZE-write \
>> $seqres.full 2>&1
- src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
+ $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
$SUNIT_BLOCKS | _filter_scratch
- src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-write \
+ $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-write \
$SUNIT_BLOCKS | _filter_scratch
done
done
echo "=== Testing size 1g falloc on ${SUNIT_K}k stripe ==="
$XFS_IO_PROG -f -c "falloc 0 1g" \
$SCRATCH_MNT/file-1g-falloc >> $seqres.full 2>&1
- src/t_stripealign $SCRATCH_MNT/file-1g-falloc $SUNIT_BLOCKS \
+ $here/src/t_stripealign $SCRATCH_MNT/file-1g-falloc $SUNIT_BLOCKS \
| _filter_scratch
rm -f $SCRATCH_MNT/file-1g-falloc | _filter_scratch
echo "=== Testing size 1073745920 falloc on ${SUNIT_K}k stripe ==="
$XFS_IO_PROG -f -c "falloc 0 1073745920" \
$SCRATCH_MNT/file-1073745920-falloc >> $seqres.full 2>&1
- src/t_stripealign $SCRATCH_MNT/file-1073745920-falloc \
+ $here/src/t_stripealign $SCRATCH_MNT/file-1073745920-falloc \
$SUNIT_BLOCKS | _filter_scratch
_scratch_unmount
# realtime subvolume, thus the test will fail with rtinherit=1
_require_no_rtinherit
_require_aiodio "aiocp"
-AIO_TEST="src/aio-dio-regress/aiocp"
+AIO_TEST="$here/src/aio-dio-regress/aiocp"
rm -f $seqres.full
for n in {1..168}; do
touch $TEST_DIR/ttt/$n;
done
-src/t_dir_offset2 $TEST_DIR/ttt
+$here/src/t_dir_offset2 $TEST_DIR/ttt
# success, all done
echo "*** done"
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
+here=`pwd`
status=1 # failure is the default!
_cleanup()
_test_read()
{
- src/t_readdir_1 $SEQ_DIR &
+ $here/src/t_readdir_1 $SEQ_DIR &
sleep $RUN_TIME
$KILLALL_PROG t_readdir_1
check_kernel_bug
_test_lseek()
{
- src/t_readdir_2 $SEQ_DIR &
+ $here/src/t_readdir_2 $SEQ_DIR &
sleep $RUN_TIME
$KILLALL_PROG t_readdir_2
check_kernel_bug
_print_numeric_uid()
{
echo "From init_user_ns"
- src/lstat64 $file |head -3 |_filter_output
+ $here/src/lstat64 $file |head -3 |_filter_output
echo "From user_ns"
- src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" src/lstat64 $file |head -3 |_filter_output
+ $here/src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" $here/src/lstat64 $file |head -3 |_filter_output
}
_scratch_unmount >/dev/null 2>&1
chmod 777 $SCRATCH_MNT
# create $file as "root" in userns, which is $qa_user in parent namespace
-src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" touch $file
+$here/src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" touch $file
_print_numeric_uid
_require_cp_reflink
_require_dm_target error
_require_aiodio "aiocp"
-AIO_TEST="src/aio-dio-regress/aiocp"
+AIO_TEST="$here/src/aio-dio-regress/aiocp"
rm -f $seqres.full
_require_scratch_reflink
_require_cp_reflink
_require_aiodio "aiocp"
-AIO_TEST="src/aio-dio-regress/aiocp"
+AIO_TEST="$here/src/aio-dio-regress/aiocp"
rm -f $seqres.full
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-src/holetest -f $SCRATCH_MNT/testfile 1
-src/holetest -f $SCRATCH_MNT/testfile 16
-src/holetest -f $SCRATCH_MNT/testfile 256
+$here/src/holetest -f $SCRATCH_MNT/testfile 1
+$here/src/holetest -f $SCRATCH_MNT/testfile 16
+$here/src/holetest -f $SCRATCH_MNT/testfile 256
status=0
exit
seq=`basename $0`
seqres=$RESULT_DIR/$seq
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
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-src/holetest -f -r $SCRATCH_MNT/testfile 16
-src/holetest -f -r $SCRATCH_MNT/testfile 256
-src/holetest -f -r -w $SCRATCH_MNT/testfile 16
-src/holetest -f -r -w $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -r $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -r $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -r -w $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -r -w $SCRATCH_MNT/testfile 256
status=0
exit
seq=`basename $0`
seqres=$RESULT_DIR/$seq
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
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-src/holetest -f -F $SCRATCH_MNT/testfile 16
-src/holetest -f -F $SCRATCH_MNT/testfile 256
-src/holetest -f -F -r $SCRATCH_MNT/testfile 16
-src/holetest -f -F -r $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -F $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -F $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -F -r $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -F -r $SCRATCH_MNT/testfile 256
status=0
exit
seq=`basename $0`
seqres=$RESULT_DIR/$seq
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
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-src/holetest -f -w $SCRATCH_MNT/testfile 1
-src/holetest -f -w $SCRATCH_MNT/testfile 16
-src/holetest -f -w $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -w $SCRATCH_MNT/testfile 1
+$here/src/holetest -f -w $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -w $SCRATCH_MNT/testfile 256
status=0
exit
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-src/holetest -f -p $SCRATCH_MNT/testfile 16
-src/holetest -f -p $SCRATCH_MNT/testfile 256
-src/holetest -f -p -F $SCRATCH_MNT/testfile 16
-src/holetest -f -p -F $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -p $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -p $SCRATCH_MNT/testfile 256
+$here/src/holetest -f -p -F $SCRATCH_MNT/testfile 16
+$here/src/holetest -f -p -F $SCRATCH_MNT/testfile 256
status=0
exit
umask 022
touch $SCRATCH_MNT/testfile
- if src/feature -c $SCRATCH_MNT/testfile; then
+ if $here/src/feature -c $SCRATCH_MNT/testfile; then
:
else
_notrun "Installed fileutils doesn't support 32 bit uids/gids"
chown 12345 $SCRATCH_MNT/testfile
chgrp 54321 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+ $here/src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
chown 34567 $SCRATCH_MNT/testfile
chgrp 76543 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+ $here/src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
chown 56789 $SCRATCH_MNT/testfile
chgrp 98765 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+ $here/src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
# finally give back to original owners
chown 12345 $SCRATCH_MNT/testfile
chgrp 54321 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+ $here/src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
echo
_scratch_unmount 2>/dev/null
_qmount_option "usrquota,grpquota"
_qmount
-if src/feature -G $SCRATCH_DEV ; then
+if $here/src/feature -G $SCRATCH_DEV ; then
:
else
_notrun "No quota support at mount time"
# always trigger the wrong unlock flags bug we had in older kernels.
#
for i in `seq 1 2000`; do
- src/rename test t/test
+ $here/src/rename test t/test
done
# success, all done
ln $edir1/efile1 $edir2/efile1 |& _filter_scratch | filter_eperm_to_exdev
echo -e "\n*** Rename encrypted => encrypted ***"
-src/renameat2 $edir1/efile1 $edir2/efile1 |& filter_eperm_to_exdev
+$here/src/renameat2 $edir1/efile1 $edir2/efile1 |& filter_eperm_to_exdev
# Test linking and renaming an unencrypted file into an encrypted directory.
ln $udir/ufile $edir1/ufile |& _filter_scratch | filter_eperm_to_exdev
echo -e "\n*** Rename unencrypted => encrypted ***"
-src/renameat2 $udir/ufile $edir1/ufile |& filter_eperm_to_exdev
+$here/src/renameat2 $udir/ufile $edir1/ufile |& filter_eperm_to_exdev
# Test linking and renaming an encrypted file into an unencrypted directory.
rm $udir/efile1 # undo
echo -e "\n*** Rename encrypted => unencrypted ***"
-src/renameat2 $edir1/efile1 $udir/efile1
-src/renameat2 $udir/efile1 $edir1/efile1 # undo
+$here/src/renameat2 $edir1/efile1 $udir/efile1
+$here/src/renameat2 $udir/efile1 $edir1/efile1 # undo
# Test renaming a forbidden (unencrypted, or encrypted with a different
# rename) operation. Should fail with EXDEV.
echo -e "\n\n*** Exchange encrypted <=> encrypted ***"
-src/renameat2 -x $edir1/efile1 $edir2/efile2 |& filter_eperm_to_exdev
+$here/src/renameat2 -x $edir1/efile1 $edir2/efile2 |& filter_eperm_to_exdev
echo -e "\n*** Exchange unencrypted <=> encrypted ***"
-src/renameat2 -x $udir/ufile $edir1/efile1 |& filter_eperm_to_exdev
+$here/src/renameat2 -x $udir/ufile $edir1/efile1 |& filter_eperm_to_exdev
echo -e "\n*** Exchange encrypted <=> unencrypted ***"
-src/renameat2 -x $edir1/efile1 $udir/ufile |& filter_eperm_to_exdev
+$here/src/renameat2 -x $edir1/efile1 $udir/ufile |& filter_eperm_to_exdev
# Test a file with a special type, i.e. not regular, directory, or symlink.
echo -e "\n\n*** Special file tests ***"
mkfifo $edir1/fifo
-src/renameat2 $edir1/fifo $edir2/fifo
-src/renameat2 $edir2/fifo $udir/fifo
-src/renameat2 $udir/fifo $edir1/fifo
+$here/src/renameat2 $edir1/fifo $edir2/fifo
+$here/src/renameat2 $edir2/fifo $udir/fifo
+$here/src/renameat2 $udir/fifo $edir1/fifo
mkfifo $udir/fifo
-src/renameat2 -x $udir/fifo $edir1/fifo
+$here/src/renameat2 -x $udir/fifo $edir1/fifo
ln -v $edir1/fifo $edir2/fifo | _filter_scratch
rm $edir1/fifo $edir2/fifo $udir/fifo
efile2=$(find $edir2 -type f)
echo -e "\n\n*** Exchange encrypted <=> encrypted without key ***"
-src/renameat2 -x $efile1 $efile2 |& filter_eperm_to_enokey
+$here/src/renameat2 -x $efile1 $efile2 |& filter_eperm_to_enokey
echo -e "\n*** Exchange encrypted <=> unencrypted without key ***"
-src/renameat2 -x $efile1 $udir/ufile |& filter_eperm_to_enokey
+$here/src/renameat2 -x $efile1 $udir/ufile |& filter_eperm_to_enokey
# success, all done
status=0
# or DT_UNKNOWN on fs without filetype support
ftype=
_supports_filetype $SCRATCH_MNT && ftype=1
-src/t_dir_type $testdir | \
+$here/src/t_dir_type $testdir | \
while read name type; do
if [ "$ftype" != 1 -a "$type" = u ]; then
if [ "$name" = "." -o "$name" = ".." ]; then
{
prep_files
# with O_DIRECT first
- src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
prep_files
# again with buffered IO
- src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
$1 "buffered both dax"
}
t_nondax_to_dax()
{
prep_files
- src/t_mmap_dio $TEST_DIR/tf_s \
+ $here/src/t_mmap_dio $TEST_DIR/tf_s \
$SCRATCH_MNT/tf_d $1 "dio nondax to dax"
prep_files
- src/t_mmap_dio -b $TEST_DIR/tf_s \
+ $here/src/t_mmap_dio -b $TEST_DIR/tf_s \
$SCRATCH_MNT/tf_d $1 "buffered nondax to dax"
}
t_dax_to_nondax()
{
prep_files
- src/t_mmap_dio $SCRATCH_MNT/tf_s \
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_s \
$TEST_DIR/tf_d $1 "dio dax to nondax"
prep_files
- src/t_mmap_dio -b $SCRATCH_MNT/tf_s \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_s \
$TEST_DIR/tf_d $1 "buffered dax to nondax"
}
t_both_nondax()
{
prep_files
- src/t_mmap_dio $TEST_DIR/tf_{s,d} $1 "dio both nondax"
+ $here/src/t_mmap_dio $TEST_DIR/tf_{s,d} $1 "dio both nondax"
prep_files
- src/t_mmap_dio -b $TEST_DIR/tf_{s,d} \
+ $here/src/t_mmap_dio -b $TEST_DIR/tf_{s,d} \
$1 "buffered both nondax"
}
# less than page size
t_mmap_dio_dax 1024
# page size
- t_mmap_dio_dax `src/feature -s`
+ t_mmap_dio_dax `$here/src/feature -s`
# bigger sizes, for PMD faults
t_mmap_dio_dax $((16 * 1024 * 1024))
t_mmap_dio_dax $((64 * 1024 * 1024))
delay=100
echo "open and unlink $num_files files with EAs"
- src/multi_open_unlink -f $SCRATCH_MNT/test_file \
+ $here/src/multi_open_unlink -f $SCRATCH_MNT/test_file \
-n $num_files -s $delay -e $num_eas -v $ea_val_size &
pid=$!
diotest=$here/src/dio-invalidate-cache
testfile=$TEST_DIR/$seq-diotest
sectorsize=`blockdev --getss $TEST_DEV`
-pagesize=`src/feature -s`
+pagesize=`$here/src/feature -s`
# test case array, test different write/read combinations
# -r: use direct read
efile1=$(find $SCRATCH_MNT/edir -maxdepth 1 -type f | head -1)
efile2=$(find $SCRATCH_MNT/edir -maxdepth 1 -type f | tail -1)
mv $efile1 $efile2 |& _filter_scratch | sed 's|edir/[a-zA-Z0-9+,_]\+|edir/FILENAME|g'
-src/renameat2 -x $efile1 $efile2
+$here/src/renameat2 -x $efile1 $efile2
# success, all done
status=0
mkdir -p $dir
rm -f $dir/*
- src/open_by_handle -c $dir $NUMFILES
+ $here/src/open_by_handle -c $dir $NUMFILES
}
# Test encode/decode file handles
local opt=$2
echo test_file_handles $* | _filter_test_dir
- src/open_by_handle $opt $dir $NUMFILES
+ $here/src/open_by_handle $opt $dir $NUMFILES
}
# Check stale handles to deleted files
_require_test_program "t_mmap_stale_pmd"
# real QA test starts here
-src/t_mmap_stale_pmd $TEST_DIR/testfile
+$here/src/t_mmap_stale_pmd $TEST_DIR/testfile
# success, all done
echo "Silence is golden"
_require_test_program "t_mmap_cow_race"
# real QA test starts here
-src/t_mmap_cow_race $TEST_DIR/testfile
+$here/src/t_mmap_cow_race $TEST_DIR/testfile
# success, all done
echo "Silence is golden"
SYNCPID=$!
# Run the test
-src/t_mmap_fallocate $FILE 256 && echo "Silence is golden"
+$here/src/t_mmap_fallocate $FILE 256 && echo "Silence is golden"
kill -TERM $SYNCPID
wait $SYNCPID
# run test programme, read another file writing into
# the read-only file with mmap, which should fail.
+#
+# don't use $here/src/t_mmap_write_ro, as we're running it as a regular user,
+# and $here may contain path component that a regular user doesn't have search
+# permission
_user_do "src/t_mmap_write_ro $TEST_DIR/${seq}.file \
$SCRATCH_MNT/readonlyfile"
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
+here=`pwd`
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
}
-./src/attr_replace_test $SCRATCH_MNT/hello
+$here/src/attr_replace_test $SCRATCH_MNT/hello
$ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
$ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output
file=$SCRATCH_MNT/file
filesize=$((1024 * 1024 * 32))
-pagesize=`src/feature -s`
+pagesize=`$here/src/feature -s`
truncsize=$((filesize - pagesize))
for i in $(seq 0 15); do
[ $fs = ext4dev ] && preargs="-F"
# overwite the first few Kb - should blow away superblocks
- src/devzero -n 20 $SCRATCH_DEV >/dev/null
+ $here/src/devzero -n 20 $SCRATCH_DEV >/dev/null
# create a filesystem of this type
echo "=== Creating $fs filesystem..." >>$seqres.full
echo "*** test 1 - reservations cleared on O_TRUNC"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
m
EOF
_filesize $out
-cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 2 - reserve & filesize"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
EOF
echo "*** test 3 - alloc & filesize"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
EOF
echo "*** test 4 - allocations cleared on O_TRUNC"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
EOF
_filesize $out
-cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out -t | _block_filter
m
EOF
_filesize $out
echo "*** test 5 - reserve / unreserve"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
r 0 100b
u 100b 500b
m
echo "*** test 6 - reserve adjacent"
rm -f $out
-cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -t -n -b $bsize -f $out | _block_filter
r 0 100b
r 100b 100b
m
echo "*** test 7 - alloc"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
m
a 2000b
echo "*** test 8 - alloc & truncate"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
a 1000b
m
t 500b
echo "*** test 9 - reserve & truncate"
rm -f $out
-cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
+cat <<EOF | $here/src/alloc -n -b $bsize -f $out | _block_filter
r 0 1000b
m
t 500b
_create_dumpdir_fill
# ensure file/dir timestamps precede dump timestamp
sleep 2
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
_erase_hard
_do_dump
_append_dumpdir_fill
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
_erase_hard
_do_dump -l 1
_do_restore
else
_qmount_option noquota
_scratch_mount
- src/feature -U $SCRATCH_DEV && \
+ $here/src/feature -U $SCRATCH_DEV && \
_notrun "UQuota are enabled, test needs controlled sb recovery"
- src/feature -G $SCRATCH_DEV && \
+ $here/src/feature -G $SCRATCH_DEV && \
_notrun "GQuota are enabled, test needs controlled sb recovery"
- src/feature -P $SCRATCH_DEV && \
+ $here/src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
_scratch_unmount
fi
print "clear=", $1 / 512, "\n"; exit
}'`
[ -z "$clear" ] && echo "Cannot calculate length to clear"
-src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null
+$here/src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null
# now kick off the real repair test...
#
rm -f $seqres.full
SECTORSIZE=`blockdev --getss $SCRATCH_DEV`
-PAGESIZE=`src/feature -s`
+PAGESIZE=`$here/src/feature -s`
IMGFILE=$TEST_DIR/${seq}_copy.img
echo "Silence is golden."
# check we won't get any quota inodes setup on mount
_qmount_option noquota
_scratch_mount
-src/feature -U $SCRATCH_DEV && \
+$here/src/feature -U $SCRATCH_DEV && \
_notrun "UQuota are enabled, test needs controlled sb recovery"
-src/feature -G $SCRATCH_DEV && \
+$here/src/feature -G $SCRATCH_DEV && \
_notrun "GQuota are enabled, test needs controlled sb recovery"
-src/feature -P $SCRATCH_DEV && \
+$here/src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
_scratch_unmount
exit
fi
-if ! src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >>$seqres.full 2>&1
+if ! $here/src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >>$seqres.full 2>&1
then
echo "!!! failed to run xfsctl test program"
exit
{
if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
_do "Fill filesystem" \
- "src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
+ "$here/src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
}
_do_die_on_error=message_only
_do "_try_scratch_mount"
echo "done"
echo -n "Check files... "
- if ! _do "src/fill2fs_check $tmp.manifest"; then
+ if ! _do "$here/src/fill2fs_check $tmp.manifest"; then
echo "fail (see $seqres.full)"
_do "cat $tmp.manifest"
_do "ls -altrR $SCRATCH_MNT"
echo "done"
echo -n "Create one very large file... "
-_do "src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented"
+_do "$here/src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented"
echo "done"
_do "xfs_bmap -v $SCRATCH_MNT/fragmented"
_do "sum $SCRATCH_MNT/fragmented >$tmp.sum1"
_supported_os Linux
_require_test
-src/fault $TEST_DIR || exit
+$here/src/fault $TEST_DIR || exit
# success, all done
status=0
_qmount
# setup user/group to test
-if src/feature -U $SCRATCH_DEV ; then
+if $here/src/feature -U $SCRATCH_DEV ; then
type=u; eval `_choose_uid`
-elif src/feature -G $SCRATCH_DEV ; then
+elif $here/src/feature -G $SCRATCH_DEV ; then
type=g; eval `_choose_gid`
-elif src/feature -P $SCRATCH_DEV ; then
+elif $here/src/feature -P $SCRATCH_DEV ; then
type=p; eval `_choose_prid`
else
_notrun "No quota support at mount time"
# override dump_file to checked-in dumpfile
# we have no quotas to restore
# if we happen to run this on crackle then put the hostname back
-_do_restore_file --no-check-quota -f src/dumpfile -L stress_056 |
+_do_restore_file --no-check-quota -f $here/src/dumpfile -L stress_056 |
sed -e 's/HOSTNAME/crackle/g' -e 's#SCRATCH_DEV#/dev/dsk/dks0d2s1#'
_diff_compare_sub
_ls_nodate_compare_sub
_bstat_count()
{
batchsize=$1
- ./src/bstat $SCRATCH_MNT $batchsize | grep ino | wc -l
+ $here/src/bstat $SCRATCH_MNT $batchsize | grep ino | wc -l
}
# print bulkstat counts using varied batch sizes
}
rm -f $TEST_DIR/testfile
-if src/feature -t $TEST_DIR/testfile; then
+if $here/src/feature -t $TEST_DIR/testfile; then
:
else
_notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
. ./common/rc
. ./common/filter
-bitsperlong=`src/feature -w`
+bitsperlong=`$here/src/feature -w`
# link correct .out file
rm -f $seqfull.out
if [ "$bitsperlong" -eq 32 ]; then
# mount with quotas?
_scratch_mkfs_xfs "-l version=1" 1>/dev/null 2>&1
_qmount
-src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
+$here/src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
_scratch_unmount
_mkfs_log "-l version=1"
| awk '{print $2}' | sed s/[\(\)]//g`
echo Blat inode clusters
-src/itrash $SCRATCH_DEV $BYTE
+$here/src/itrash $SCRATCH_DEV $BYTE
_try_scratch_mount || _fail "Couldn't mount after itrash"
echo Attempting bulkstat
-#src/bstat -q $SCRATCH_MNT
+#$here/src/bstat -q $SCRATCH_MNT
$XFS_FSR_PROG -g $SCRATCH_MNT | _filter_scratch
# Fix up intentional corruption so test can pass
-c "pwrite -S 0x68 -b 1048576 0 $len2" \
$SCRATCH_MNT/f2 >> $seqres.full
-./src/punch-alternating -o $((16 * blksz / file_blksz)) \
+$here/src/punch-alternating -o $((16 * blksz / file_blksz)) \
-s $((blksz / file_blksz)) \
-i $((blksz * 2 / file_blksz)) \
$SCRATCH_MNT/f1 >> "$seqres.full"
num_files=200
delay=5
echo "open and unlink $num_files files"
-src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
+$here/src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
# time to create and unlink all the files
sleep 3
{
num=$1
echo ""; echo "** $num extents **"
- src/makeextents -v -p -w -n $num $file
+ $here/src/makeextents -v -p -w -n $num $file
}
_print_inode()
delay=100
echo "open and unlink $num_files files with EAs"
-src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay -e $num_eas -v $ea_val_size &
+$here/src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay -e $num_eas -v $ea_val_size &
pid=$!
# time to create and unlink all the files
_supported_os Linux
_require_test
-bitsperlong=`src/feature -w`
+bitsperlong=`$here/src/feature -w`
if [ "$bitsperlong" -ne 32 ]; then
_notrun "This test is only valid on 32 bit machines"
fi
for n in {1..168}; do
touch $TEST_DIR/ttt/$n;
done
-src/t_dir_offset $TEST_DIR/ttt
+$here/src/t_dir_offset $TEST_DIR/ttt
# success, all done
echo "*** done"
_require_test
_require_loop
-bitsperlong=`src/feature -w`
+bitsperlong=`$here/src/feature -w`
if [ "$bitsperlong" -ne 64 ]; then
_notrun "This test is only valid on 64 bit machines"
fi
_scratch_mkfs > /dev/null 2>&1
_scratch_mount > /dev/null 2>&1
-src/stale_handle $SCRATCH_MNT
+$here/src/stale_handle $SCRATCH_MNT
status=$?
exit
_require_dm_target error
_require_xfs_io_command "cowextsize"
_require_aiodio "aiocp"
-AIO_TEST="src/aio-dio-regress/aiocp"
+AIO_TEST="$here/src/aio-dio-regress/aiocp"
rm -f $seqres.full
_require_cp_reflink
_require_xfs_io_command "cowextsize"
_require_aiodio "aiocp"
-AIO_TEST="src/aio-dio-regress/aiocp"
+AIO_TEST="$here/src/aio-dio-regress/aiocp"
rm -f $seqres.full
prep_files
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
# with O_DIRECT first
- src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
prep_files
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
# again with buffered IO
- src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
$1 "buffered both dax"
}
prep_files
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
- src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
$1 "dio nondax to dax"
prep_files
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
- src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
$1 "buffered nondax to dax"
}
prep_files
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
- src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
$1 "dio dax to nondax"
prep_files
$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
- src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
$1 "buffered dax to nondax"
}
{
prep_files
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
- src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
$1 "dio both nondax"
prep_files
$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
- src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+ $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
$1 "buffered both nondax"
}
# less than page size
t_dax_flag_mmap_dio 1024
# page size
- t_dax_flag_mmap_dio `src/feature -s`
+ t_dax_flag_mmap_dio `$here/src/feature -s`
# bigger sizes, for PMD faults
t_dax_flag_mmap_dio $((16 * 1024 * 1024))
t_dax_flag_mmap_dio $((64 * 1024 * 1024))
__populate_create_attr $SCRATCH_MNT/foo 100
echo "Run test program"
-./src/attr-list-by-handle-cursor-test $SCRATCH_MNT/foo
+$here/src/attr-list-by-handle-cursor-test $SCRATCH_MNT/foo
# success, all done
status=0
_pwrite_byte 0x80 0 737373 $SCRATCH_MNT/urk >> $seqres.full
sync
-./src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full
+$here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full
ino=$(stat -c '%i' $SCRATCH_MNT/urk)
echo "Get fsmap" | tee -a $seqres.full
_pwrite_byte 0x80 0 737373 $SCRATCH_MNT/f1 >> $seqres.full
sync
-./src/punch-alternating $SCRATCH_MNT/f1 >> $seqres.full
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> $seqres.full
_cp_reflink $SCRATCH_MNT/f1 $SCRATCH_MNT/f2
ino=$(stat -c '%i' $SCRATCH_MNT/f1)
$XFS_IO_PROG -f -R -c 'pwrite -S 0x80 0 737373' $SCRATCH_MNT/urk >> $seqres.full
sync
-./src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full
+$here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full
ino=$(stat -c '%i' $SCRATCH_MNT/urk)
echo "Get fsmap" | tee -a $seqres.full
_create_dumpdir_fill
# ensure file/dir timestamps precede dump timestamp
sleep 2
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
echo "*** Level 0 dump, format 2"
_do_dump_file -f $tmp.l0 -K
_append_dumpdir_fill
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
echo "*** Level 1 dump, current format"
_do_dump_file -l 1 -f $tmp.l1
_create_dumpdir_fill
# ensure file/dir timestamps precede dump timestamp
sleep 2
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
echo "*** Level 0 dump, current format"
_do_dump_file -f $tmp.l0
_append_dumpdir_fill
-src/bstat $SCRATCH_MNT >>$seqres.full
+$here/src/bstat $SCRATCH_MNT >>$seqres.full
echo "*** Level 1 dump, format 2"
_do_dump_file -l 1 -f $tmp.l1 -K
STRESS_DIR="$SCRATCH_MNT/testdir"
mkdir -p $STRESS_DIR
-cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
+cpus=$(( $($here/src/feature -o) * 4 * LOAD_FACTOR))
$FSSTRESS_PROG -d $STRESS_DIR -p $cpus -n $((cpus * 100000)) $FSSTRESS_AVOID >/dev/null 2>&1 &
$XFS_SCRUB_PROG -d -T -v -n $SCRATCH_MNT >> $seqres.full
STRESS_DIR="$SCRATCH_MNT/testdir"
mkdir -p $STRESS_DIR
-cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
+cpus=$(( $($here/src/feature -o) * 4 * LOAD_FACTOR))
$FSSTRESS_PROG -d $STRESS_DIR -p $cpus -n $((cpus * 100000)) $FSSTRESS_AVOID >/dev/null 2>&1 &
$XFS_SCRUB_PROG -d -T -v -n $SCRATCH_MNT >> $seqres.full
# Fill remaining space; let this run to failure
dd if=/dev/zero of=$SCRATCH_MNT/spacefile1 oflag=direct >> $seqres.full 2>&1
# Fragment our all-consuming file
-./src/punch-alternating $SCRATCH_MNT/fragfile >> $seqres.full 2>&1
+$here/src/punch-alternating $SCRATCH_MNT/fragfile >> $seqres.full 2>&1
# Punching might have freed up large-ish swaths of metadata
# Consume hopefully any remaining contiguous freespace
echo "+ make some files"
$XFS_IO_PROG -f -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full
$XFS_IO_PROG -f -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
# success, all done
status=0
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
echo "Explode the rtrmapbt"
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
_scratch_cycle_mount
echo "Remove half the records"
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
echo "Explode the rtrmapbt"
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
_scratch_cycle_mount
echo "Create metadump file"
echo "+ make some files"
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
_scratch_unmount
echo "+ check fs"
echo "Create some files"
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
echo garbage > $SCRATCH_MNT/f3
ino=$(stat -c '%i' $SCRATCH_MNT/f3)
_scratch_unmount
echo "Create some files"
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full
$XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full
-./src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
-./src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full"
+$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full"
echo garbage > $SCRATCH_MNT/f3
ino=$(stat -c '%i' $SCRATCH_MNT/f3)
_scratch_unmount
done
done
-cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
+cpus=$(( $($here/src/feature -o) * 4 * LOAD_FACTOR))
echo "Concurrent repair"
filter_output() {
$XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/a >> $seqres.full
$XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/b >> $seqres.full
-./src/punch-alternating $SCRATCH_MNT/b
+$here/src/punch-alternating $SCRATCH_MNT/b
sync
echo "Set up delalloc extents"
# files with large enough extent counts (200 or so should be plenty) to ensure
# btree format on the largest possible inode size filesystems.
$XFS_IO_PROG -fc "falloc 0 $((400 * dbsize))" $file1
-./src/punch-alternating $file1
+$here/src/punch-alternating $file1
$XFS_IO_PROG -fc "falloc 0 $((400 * dbsize))" $file2
-./src/punch-alternating $file2
+$here/src/punch-alternating $file2
# Now run an extent swap at every possible extent count down to 0. Depending on
# inode size, one of these swaps will cover the boundary case between extent and
filesz=$((bno_maxrecs * 3 * blksz))
rm -rf $SCRATCH_MNT/a
$XFS_IO_PROG -f -c "falloc 0 $filesz" $SCRATCH_MNT/a >> $seqres.full 2>&1
- test -e $SCRATCH_MNT/a && ./src/punch-alternating $SCRATCH_MNT/a
+ test -e $SCRATCH_MNT/a && $here/src/punch-alternating $SCRATCH_MNT/a
rm -rf $SCRATCH_MNT/a
_scratch_unmount 2>&1 | _filter_scratch
bstat_compare()
{
bstat_versions | while read v_tag v_flag; do
- diff -u <(./src/bstat $SCRATCH_MNT | grep ino | awk '{print $2}') \
+ diff -u <($here/src/bstat $SCRATCH_MNT | grep ino | awk '{print $2}') \
<($XFS_IO_PROG -c "bulkstat $v_flag" $SCRATCH_MNT | grep ino | awk '{print $3}')
done
}
rm -f $seqres.full
echo "Silence is golden."
-src/bulkstat_null_ocount $TEST_DIR
+$here/src/bulkstat_null_ocount $TEST_DIR
# success, all done
status=0