fstests: Add path $here before src/<file>
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 21 Oct 2019 13:35:46 +0000 (21:35 +0800)
committerEryu Guan <guaneryu@gmail.com>
Wed, 23 Oct 2019 15:12:42 +0000 (23:12 +0800)
Calling src/<file> without path '$here' may cause the problem that
the file cannot be found.

For example, Running generic/192 with overlayfs(Let ubifs as base
fs) yields the following output:

  generic/192 - output mismatch
     QA output created by 192
     sleep for 5 seconds
     test
    +./common/rc: line 316: src/t_dir_type: No such file or directory
     delta1 is in range
     delta2 is in range
    ...

When the use case fails, the call stack in generic/192 is:

  local unknowns=$(src/t_dir_type $dir u | wc -l) common/rc
  _supports_filetype common/rc
  _overlay_mount common/overlay
  _overlay_test_mount common/overlay
  _test_mount common/rc
  _test_cycle_mount generic/192

Before _test_cycle_mount() being invoked, generic/192 executed 'cd
/' to change work dir from 'xfstests-dev' to '/', so src/t_dir_type
was not found.

[Eryu: some tests run src/<file> as regular user, don't add $here
prefix in such case, as a regular user may have no search permission
on $here]

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
94 files changed:
common/encrypt
common/locktest
common/populate
common/quota
common/rc
common/renameat2
common/repair
tests/generic/002
tests/generic/014
tests/generic/035
tests/generic/042
tests/generic/068
tests/generic/084
tests/generic/088
tests/generic/093
tests/generic/120
tests/generic/124
tests/generic/125
tests/generic/129
tests/generic/223
tests/generic/252
tests/generic/257
tests/generic/310
tests/generic/317
tests/generic/331
tests/generic/332
tests/generic/340
tests/generic/344
tests/generic/345
tests/generic/346
tests/generic/354
tests/generic/379
tests/generic/385
tests/generic/398
tests/generic/401
tests/generic/413
tests/generic/417
tests/generic/418
tests/generic/419
tests/generic/426
tests/generic/428
tests/generic/437
tests/generic/438
tests/generic/462
tests/generic/486
tests/generic/524
tests/shared/032
tests/xfs/009
tests/xfs/024
tests/xfs/030
tests/xfs/032
tests/xfs/033
tests/xfs/034
tests/xfs/041
tests/xfs/042
tests/xfs/048
tests/xfs/052
tests/xfs/061
tests/xfs/062
tests/xfs/066
tests/xfs/071
tests/xfs/081
tests/xfs/111
tests/xfs/114
tests/xfs/121
tests/xfs/136
tests/xfs/181
tests/xfs/197
tests/xfs/206
tests/xfs/238
tests/xfs/240
tests/xfs/241
tests/xfs/260
tests/xfs/269
tests/xfs/272
tests/xfs/274
tests/xfs/276
tests/xfs/282
tests/xfs/283
tests/xfs/285
tests/xfs/286
tests/xfs/294
tests/xfs/331
tests/xfs/335
tests/xfs/336
tests/xfs/337
tests/xfs/341
tests/xfs/342
tests/xfs/422
tests/xfs/423
tests/xfs/443
tests/xfs/444
tests/xfs/509
tests/xfs/510

index 06a56ed92a7dd5cf37a5e5fad2da102dc3c2352f..535b035fd39d9e5270841429248d510f89b92b03 100644 (file)
@@ -467,7 +467,7 @@ _do_verify_ciphertext_for_encryption_policy()
        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=()
index 1da5fbb1eb62acfac615a03eeacd2d8a13307f13..61e7dd42785dd3d4f21050e10bd5ec9d76a3b15a 100644 (file)
@@ -45,7 +45,7 @@ _run_generic() {
        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
@@ -71,7 +71,7 @@ _run_generic() {
 
        # 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
index f2953a674d8dc03f9c4d90e3fbdf8fff0bde34e6..eeac66d70c4a030bd29efcf4e14d8fc119d8e382 100644 (file)
@@ -39,7 +39,7 @@ __populate_create_file() {
 __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
index 5e154fad6a35d1ab5aec4a5fd5edf9efbccecbb3..6d1948bf357e29bc1a69ecae57bbc7a451bdf74d 100644 (file)
@@ -42,7 +42,7 @@ _require_quota()
 #
 _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"
@@ -87,7 +87,7 @@ _require_prjquota()
        [ $? -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
index a29bd7809c1ad754e953f7eee45302d9f37b3a69..bbebadd2d82288f03acb99dab106700ac8607fc6 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -313,7 +313,7 @@ _supports_filetype()
                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
@@ -386,10 +386,10 @@ _scratch_shutdown()
                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
 }
 
@@ -1295,7 +1295,7 @@ _is_block_dev()
     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
 }
 
@@ -1314,7 +1314,7 @@ _is_char_dev()
        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
 }
 
@@ -1919,10 +1919,10 @@ _require_aiodio()
 {
     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
@@ -1934,7 +1934,7 @@ _require_aiodio()
 #
 _require_test_program()
 {
-    local prog=src/$1
+    local prog=$here/src/$1
     [ -x $prog ] || _notrun "$prog not built"
 }
 
@@ -3095,7 +3095,7 @@ _require_exportfs()
 # 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
@@ -3108,11 +3108,11 @@ _require_scratch_shutdown()
                        # 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
 
@@ -3347,8 +3347,8 @@ _require_relatime()
 
 _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()
@@ -3426,7 +3426,7 @@ _require_ofd_locks()
        # 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"
 }
 
index 2538141caf728da5c04f1b2974c824ba388add11..4b64eea7824be18dfa9561fa154b9e622a9bf637 100644 (file)
@@ -67,7 +67,7 @@ _rename_tests_source_dest()
                        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 "/"
@@ -107,7 +107,7 @@ _require_renameat2()
        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
 
@@ -133,7 +133,7 @@ _require_renameat2()
                _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
index c94939c9eba89d32499ee99b19551cbacc7a30ac..5a9097f4e2a9947019763b5e9964b578640b8336 100644 (file)
@@ -19,7 +19,7 @@ _zero_position()
                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'
 }
 
index 8242ea907c1bcf8aed351289cb570c452d711da8..575ac42ba5bae086200435ca446f0199d2d7b2f5 100755 (executable)
@@ -40,22 +40,22 @@ touch $TEST_DIR/$tmp.1
 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 do
     ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
-    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    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
index 59a6618aac45d9297918311dc53437d62e539790..2106df1dd7f43e854f85e8a98cfbbecc57755af5 100755 (executable)
@@ -45,7 +45,7 @@ echo "brevity is wit..."
 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`
index 8da3bc99976a78a2a88ced4880fa51037a884204..07a6664a13fb7bcfbb1f39c6aca7819153e284e1 100755 (executable)
@@ -43,7 +43,7 @@ file1=$rename_dir/file1
 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:"
@@ -51,7 +51,7 @@ dir1=$rename_dir/dir1
 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
index 6c62eb63ba826c13cd679b92ac1ee3d6ae3a6daa..ff7e8749ad461d00f02fe392b08c4a5e4da8cfd5 100755 (executable)
@@ -56,7 +56,7 @@ _crashtest()
        # 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
index 17ef9ca81ccb92e447e9ef168a39dc6396bcd525..17e6446f6a4ad650a36aaf2d0451eb608e3e6f60 100755 (executable)
@@ -77,7 +77,7 @@ touch $tmp.running
     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/*
index 402d8b2af234f2344a187ce4bd1a75e651fb140a..77eaeabfd9eda7493af5ed11f553ddf832d41064 100755 (executable)
@@ -54,7 +54,7 @@ _scratch_mkfs >>$seqres.full 2>&1
 _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
index 4b4e0c9e8f44596a73fa71bd1c4190e1f4dd0f98..73a328cbedfaedcbb463ee3e2f2b526d4d97ab5b 100755 (executable)
@@ -32,7 +32,7 @@ _supported_os Linux
 _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
index a2467a5bb9e0926c7142cbc79803aeb68d7b1aa7..10fdcfc788fbeaeaf457f674b7714f28b21ee839 100755 (executable)
@@ -70,6 +70,9 @@ rm -f $file
 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
 
index cef36845b3941487927fcd71eb6d9e77a58811be..48ca950807f91f70e88b01f467bc087eb61863ec 100755 (executable)
@@ -31,14 +31,14 @@ _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
 _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
 
@@ -53,8 +53,8 @@ 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
@@ -63,7 +63,7 @@ _compare_access_times $SCRATCH_MNT/lstat64 "executing file"
 #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
@@ -72,7 +72,7 @@ _compare_access_times $SCRATCH_MNT/testfile "reading file"
 #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
index 900970379003718ad114b8c17cf87b63508375fd..0af23635271d56bbe6428015e789ee771a32d87c 100755 (executable)
@@ -43,8 +43,8 @@ for TESTFILE in $TEST_DIR/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
   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
index 48811dbf315c7183deee2a59bd8dd71f05f74cc4..643ba2e3137a9d9d9cf9cd577aabcfe0ceea107a 100755 (executable)
@@ -39,13 +39,15 @@ touch $TESTFILE
 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
index d9b638b29f927c0493653fac156a6585cc73279b..e872c0abd876fdb611e7cbf1116d10bd531408b5 100755 (executable)
@@ -37,10 +37,10 @@ _scratch_mount "-o nosuid"
 
 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
index dfd8c41bd6bdc184549bc778aa265aed5cacd963..6cfd00ddec4410e90162463edeff9835f0d5ec52 100755 (executable)
@@ -56,9 +56,9 @@ for SUNIT_K in 8 16 32 64 128; do
                        $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
@@ -66,7 +66,7 @@ for SUNIT_K in 8 16 32 64 128; do
        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
@@ -74,7 +74,7 @@ for SUNIT_K in 8 16 32 64 128; do
        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
index 2e86c81936af54ad2c97f121aabe858c8c1555f4..a6d806950f93b464ae576dadddef41446495c8ba 100755 (executable)
@@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
 # 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
 
index f0d4291bbae2040d55de1d273a2959c400eff2c3..764d9d656eb2bbece563c06858874cbf15b901f9 100755 (executable)
@@ -33,7 +33,7 @@ mkdir $TEST_DIR/ttt
 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"
index 2bcf72017d45e6beb11ebbe285af1e2dae87c6df..1fcd517e4e6fea3d14e9deabe57ac7095a6694ef 100755 (executable)
@@ -27,6 +27,7 @@ seq=`basename $0`
 seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
 
+here=`pwd`
 status=1       # failure is the default!
 
 _cleanup()
@@ -87,7 +88,7 @@ done
 
 _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
@@ -98,7 +99,7 @@ _test_read()
 
 _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
index 1aded76868d9593b48103c1bde808a8b6ada2410..509887daa84338a757795503351f98a6011b3c51 100755 (executable)
@@ -58,10 +58,10 @@ _filter_output()
 _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
@@ -72,7 +72,7 @@ _scratch_mount
 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
 
index 8f5629c1b5a5479b288538dd58fca0a0e9434d89..59198c1623456a285da8f862c515926b6cdd0396 100755 (executable)
@@ -34,7 +34,7 @@ _require_scratch_reflink
 _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
 
index a01da998bc1da323b3e6832313063bcf239f7cd7..7561c798c08fb944cd9a37a47688517397a53e20 100755 (executable)
@@ -31,7 +31,7 @@ _supported_os Linux
 _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
 
index 628664a6c829eb698e37c0766658e0e0253102ba..73d8c906cff0dba854fe97e0fcb4dc9880eb9744 100755 (executable)
@@ -33,9 +33,9 @@ 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
index 242996ce725a9cf461ca704858530b5bf1784dac..937b5d93ddf469287b778b862848fb9691bf60c0 100755 (executable)
@@ -10,6 +10,8 @@
 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
@@ -34,10 +36,10 @@ rm -f $seqres.full
 _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
index 4b1e456ac0f365d41bca78986b95eb6447489a5e..7664033bc351ae638ffa082de403480dd8d50006 100755 (executable)
@@ -9,6 +9,8 @@
 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
@@ -33,10 +35,10 @@ rm -f $seqres.full
 _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
index 83ac7d89e80d4214079361881d94e6fe7361e1df..5aeeed262f904f16ab3fc9aaec5c9f78d3a2b89c 100755 (executable)
@@ -9,6 +9,8 @@
 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
@@ -33,9 +35,9 @@ rm -f $seqres.full
 _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
index b38845c8b86697c3ae8231dfd264ff9843e7a887..81595475b6a85f7f171779396314f471de7f1b32 100755 (executable)
@@ -34,10 +34,10 @@ rm -f $seqres.full
 _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
index acba9ed3d33bb39b3ef7ffd67c2ee05022e0eb63..d47aae944e0edb40cfa4851cba57eddc423b2604 100755 (executable)
@@ -57,7 +57,7 @@ _exercise()
 
        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"
@@ -65,20 +65,20 @@ _exercise()
 
        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
@@ -88,7 +88,7 @@ _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
 
 _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"
index 937131a915e7ccd42b9c855032a08cd9df455d32..9b56897b7308ae9efefcc70830208ec7b790a14b 100755 (executable)
@@ -77,7 +77,7 @@ touch $SCRATCH_MNT/test
 # 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
index d224e02122483d5700cb3e8ceaf36b6358fb6e6b..4ebdab295e83435173230bd11a9834171a644fce 100755 (executable)
@@ -84,7 +84,7 @@ echo -e "\n*** Link encrypted <= encrypted ***"
 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.
@@ -94,7 +94,7 @@ echo -e "\n\n*** Link unencrypted <= encrypted ***"
 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.
@@ -105,8 +105,8 @@ ln -v $edir1/efile1 $udir/efile1 |& _filter_scratch
 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
@@ -114,13 +114,13 @@ src/renameat2 $udir/efile1 $edir1/efile1 # undo
 # 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.
@@ -129,11 +129,11 @@ src/renameat2 -x $edir1/efile1 $udir/ufile |& filter_eperm_to_exdev
 
 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
 
@@ -148,9 +148,9 @@ efile1=$(find $edir1 -type f)
 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
index 1eb3d4a9553adf71114c4b9b2b88ff9d75a4197e..9d45fbcd34821a4639b4ddb75f8fcf187fad07c5 100755 (executable)
@@ -60,7 +60,7 @@ mknod $testdir/p p
 # 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
index 1f0dbba67eea121bf2fe5916b2772e3a1dcfab87..1ce89afff28e839b0a43f1fd17541f0f7a293e73 100755 (executable)
@@ -51,43 +51,43 @@ t_both_dax()
 {
        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"
 }
 
@@ -105,7 +105,7 @@ do_tests()
        # 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))
index b07c861126229c92337f63b5d03eb4b8181381a1..24210056a5ed0e6e772e16e6c3522ea8b3784f37 100755 (executable)
@@ -52,7 +52,7 @@ function create_dirty_orphans() {
        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=$!
 
index 6fdae0805cf96249b17ddecb61c8d7dd9d51a4a1..3aa765f88be010c8334437d0c1c554cd4a309208 100755 (executable)
@@ -48,7 +48,7 @@ _require_test_program "feature"
 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
index 0abbac90ea7aa6a1bf76f3703aea099529feabe0..dffeab38f9b6076177e191d692111bd1c1c8fa36 100755 (executable)
@@ -59,7 +59,7 @@ _scratch_cycle_mount
 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
index 7d47b2999a1928d11b4c73d9fc6849ec42b3edfc..c2ec1e4683010ad09e4b4964f502f79663e7a6b3 100755 (executable)
@@ -48,7 +48,7 @@ create_test_files()
 
        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
@@ -58,7 +58,7 @@ test_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
index 06c996a64112448127577f0b7bd11e5285336b53..ff5ca517681ff43892b63243c54cb9ff0e723cd2 100755 (executable)
@@ -37,7 +37,7 @@ _require_test
 _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"
index 0df382bed2034db9e9022a7e1659930ceebf1a83..0ac93350d840e6641bf719af0a5967aca9ae8f37 100755 (executable)
@@ -38,7 +38,7 @@ _require_test
 _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"
index d183210ebea126d5326ca509bc2d7f6a8e4130b6..6ef6f63c94a217e4e438f30f3a7a09cf1bd07ff8 100755 (executable)
@@ -57,7 +57,7 @@ echo >$FILE
 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
index c117f1b621fe6322b6ad9d15adb31045e1cd50f7..1ab6cadc3603534e5e0b05fad9a1b5ad06db9474 100755 (executable)
@@ -67,6 +67,10 @@ chown $qa_user $TEST_DIR/${seq}.file
 
 # 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"
 
index ea571efeda7670367bb8b22cae86e928734c1db6..74fab76f21e40c9f31642a5c067ca7baf0179edb 100755 (executable)
@@ -17,6 +17,7 @@ seq=`basename $0`
 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
 
@@ -50,7 +51,7 @@ filter_attr_output() {
                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
 
index bd86ec04bd62172c513648fd2b5b55b781ca8ca1..2cd11b3df00fd51bfdb8d7973da9234524422e4e 100755 (executable)
@@ -48,7 +48,7 @@ _scratch_mount
 
 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
index 3b0263b2ce78585d88dcc404e231ba411ae92a98..493845f709d69ba369cf39961ff2e379bd0d352e 100755 (executable)
@@ -57,7 +57,7 @@ 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
index 9385d3b9bdf8e5f0c6350fc291c7959f25bd0647..6a31514cc0d7fcefe70cabf082e00b49f28421ec 100755 (executable)
@@ -140,20 +140,20 @@ bsize=$(_get_file_block_size $SCRATCH_MNT)
 
 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
 
@@ -161,7 +161,7 @@ _filesize $out
 
 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
 
@@ -169,19 +169,19 @@ _filesize $out
 
 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
@@ -191,7 +191,7 @@ EOF
 
 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
@@ -199,7 +199,7 @@ EOF
 
 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
@@ -210,7 +210,7 @@ _filesize $out
 
 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
@@ -221,7 +221,7 @@ _filesize $out
 
 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
index b4ecd7900e4e81bfc3ee403126b3dd06925d4f2d..d1142143eb532eebe83771790bc74a3bab9f2392 100755 (executable)
@@ -34,11 +34,11 @@ _require_tape $TAPE_DEV
 _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
index 10854c8aa7f3058391aa47f55c7f2fa3c0e0041b..efdb6a189137f28b69ba8ec1c87dcdf34eba047f 100755 (executable)
@@ -68,11 +68,11 @@ then
 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
@@ -82,7 +82,7 @@ eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
                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...
 #
index 597fd0ee08bfed16672b981f897f474a83cace0c..af18f7557f4725625bd706bd2a30c3e03774589f 100755 (executable)
@@ -32,7 +32,7 @@ _require_test_program "feature"
 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."
index 0ce67a9cb71bf84862c2a96b6223896f625c6170..9842814d6cb2ad9a8845c3cc96ffc4d29876acea 100755 (executable)
@@ -83,11 +83,11 @@ _link_out_file_named $seqfull.out "$FEATURES"
 # 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
 
index a831a96d718e8f38aa8120deeb94cf562b80d7c7..92208b9344b5644a7cca775f3ec51e494736fc47 100755 (executable)
@@ -53,7 +53,7 @@ then
     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
index 1c45b8c344097fe3487b5a45185d3772c370638c..b2ef47cb3c9b6819c5afc6eb10fddafed6deba08 100755 (executable)
@@ -41,7 +41,7 @@ _fill()
 {
     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
@@ -69,7 +69,7 @@ do
     _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"
index 43276f7f05e308139c060ec085af7388e4106fa0..f3248e2dceb37a4447fac502fdc09eb2414127fd 100755 (executable)
@@ -101,7 +101,7 @@ _do "sum $SCRATCH_MNT/fill >$tmp.fillsum1"
 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"
index 424e15ced61fe50cd8df4e1aa9ca1a2a5654555c..22cfc842ca6e45ab224ef71b693c8d7cc748bede 100755 (executable)
@@ -30,7 +30,7 @@ _supported_fs xfs
 _supported_os Linux
 _require_test
 
-src/fault $TEST_DIR || exit
+$here/src/fault $TEST_DIR || exit
 
 # success, all done
 status=0
index fed5723f32a621c46e401046d6aa7927959c0ba3..6aec223b1861f71cd46127e16370d1bae0d1291d 100755 (executable)
@@ -53,11 +53,11 @@ chmod a+w $seqres.full     # arbitrary users will write here
 _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"
index f8a639fc1dc2c6d40243317b277803d32e621d5f..c457806a1571becc77966c9c8d868c206bbd5549 100755 (executable)
@@ -37,7 +37,7 @@ _create_dumpdir_fill_perm
 # 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
index 755c52438d113dfb53a52245ebec956e22c8fe15..cbce661aae8ca751490c26bc5ad62a83c5c89a4a 100755 (executable)
@@ -27,7 +27,7 @@ _cleanup()
 _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
index 90e1251c945a844f8c4304ed1ef3f952dbc67b56..c86fc2378c79be507cc85ea638a89e63bd06165c 100755 (executable)
@@ -38,7 +38,7 @@ _my_stat_filter()
 }
 
 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"
index d0e598ca8b4d3153d8a68946182c529d30668596..f962f6b4820e4d133ed968a2ae6fad7e3577bf9a 100755 (executable)
@@ -27,7 +27,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./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
index 39f4c3ca61c665814acb371518e4731a14e2234d..b377da75125babf0fe55d3bfa2203e288177b5c0 100755 (executable)
@@ -49,7 +49,7 @@ export MOUNT_OPTIONS="-o quota,gquota"
 # 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"
index 965eb625ada5b5746268df197fb55ffd6e285902..0db33cb8b5db552f702db30be6d2f374198a69da 100755 (executable)
@@ -52,12 +52,12 @@ BYTE=`_scratch_xfs_db -c "convert inode $INO byte" \
        | 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
index 613699e1c57693f64fb0cb1ba36d723c9d35898e..e994f576b3eac04870c7fdfb3dc2347ff3e78836 100755 (executable)
@@ -58,7 +58,7 @@ $XFS_IO_PROG -f \
        -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"
index 2e3914b77e2524f17b8a54b2bee47c2c3f7701f4..b907db4d4b8e02f4b720a6611172b1d0df6e76db 100755 (executable)
@@ -46,7 +46,7 @@ _scratch_mount
 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
index b2e70ddade2189376335f29d4cd572b6ee228c4f..c29a1baacd40f18bffbf7b2365a2f0410e64bd06 100755 (executable)
@@ -81,7 +81,7 @@ do_extents()
 {
     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()
index dba69a7024764b40253bc7870692c863617dd97c..cdd6ca198ac673aaf448fd132634fcc8619ea86f 100755 (executable)
@@ -58,7 +58,7 @@ ea_val_size=`expr 32 \* 1024`
 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
index 76f6f0d6b9a71e2e2dcee37d77b7f12c09d6caba..55a321a189714d1dc64c097be0e82fbd099ccfee 100755 (executable)
@@ -35,7 +35,7 @@ _supported_fs xfs
 _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
@@ -44,7 +44,7 @@ mkdir $TEST_DIR/ttt
 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"
index 7f4e725ec75eab4dc34724eb742f14c0ff5e013a..159e68d12fe6aeb827e2af761cc4230d395d4865 100755 (executable)
@@ -41,7 +41,7 @@ _supported_os Linux
 _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
index c6065184a0ed3c8aaf4244cb8a46e12f8c043c56..edd1a5e260cae2f789529c16e4f432acfe4a39e9 100755 (executable)
@@ -36,6 +36,6 @@ echo "Silence is golden"
 
 _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
index 0560651db12e04313e0f56f089c7e6753f02a3df..eee76eca21f944ac350270dff06db0ce8a0ea8b0 100755 (executable)
@@ -36,7 +36,7 @@ _require_cp_reflink
 _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
 
index 6b642a80197eff5a78ca8e9f8e3030d76739061d..c18937be7d131a2a29d0bcfa0f0c74948c1c3e8e 100755 (executable)
@@ -33,7 +33,7 @@ _require_scratch_reflink
 _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
 
index 4956752cdb4e581940dc3095f96910fb77fcb53e..3464ffef5a7a009170f81eb9748710224ee373c6 100755 (executable)
@@ -49,12 +49,12 @@ t_both_dax()
        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"
 }
 
@@ -63,13 +63,13 @@ t_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 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"
 }
 
@@ -78,13 +78,13 @@ t_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 $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"
 }
 
@@ -92,12 +92,12 @@ t_both_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"
 }
 
@@ -115,7 +115,7 @@ do_tests()
        # 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))
index 25ae50d0d595c0cd258cb648ee8497e727629b6e..007bcfa1bda9739436844da90b5a8d06be03be5a 100755 (executable)
@@ -44,7 +44,7 @@ mkdir $SCRATCH_MNT/foo
 __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
index 1f878deb2b2ad783ef6f664baefcdab3417643c2..9e3e1711b52cd757faea046dd33326b1c9494aa3 100755 (executable)
@@ -40,7 +40,7 @@ _scratch_mount
 
 _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
index 592c903684deaa57b7c6dbb6ebfbef6656b6b007..b42bd5d01ad1733c2bf1c54fec18da712e27fdf9 100755 (executable)
@@ -42,7 +42,7 @@ _scratch_mount
 
 _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)
 
index ed29844dd4cbd2d4e0b3d7f8ba7e2535bda29997..01f1c27527874fce06d6220552056220d05c805d 100755 (executable)
@@ -41,7 +41,7 @@ _scratch_mount
 
 $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
index 3f0d8e599d907433f8e9813962791e752ab67e01..b4d3f81d82c8cc6016bda7a70383a8bb55bfa984 100755 (executable)
@@ -37,13 +37,13 @@ _require_legacy_v2_format
 _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
index eab9f96b5cade24ad51c3d0a293c261a924a2b99..ec0f2dfa8da3e44658f205258f85215edd221118 100755 (executable)
@@ -37,13 +37,13 @@ _require_legacy_v2_format
 _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
index ad8b1bac4d797ad0c0fb0ddaec7242dca379f7a6..5c341adeba32572f91ce874f9bd4e8662081b2e7 100755 (executable)
@@ -43,7 +43,7 @@ _scratch_mount
 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
 
index 8bc1e59ef38b38184c019fc48ad7d817fbb6b103..9ad979e276ac04b2b696fd88bcbfb4877507c727 100755 (executable)
@@ -45,7 +45,7 @@ _scratch_mount
 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
 
index af0fc1248ca06930f066c093bbdee5ee7d3dda0e..67c5fbf7ded209ccfc3c7197cafb314e0508d05a 100755 (executable)
@@ -85,7 +85,7 @@ df -h $SCRATCH_MNT >> $seqres.full 2>&1
 # 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
index 8053c9584b1e0820f7b62124c2ff7e4535b29792..b26ea155400e319ab349dbdbea52d1c3683241e1 100755 (executable)
@@ -56,8 +56,8 @@ len=$((blocks * blksz))
 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
index 98255c63a982784660402fbb6239e479947d43ea..9135aac01e2e23b70d82a46adf5329b1d7d5e03f 100755 (executable)
@@ -59,8 +59,8 @@ $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCR
 $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"
index 1cb53b9371077aed28ab996618a2eda18f0d54ca..33b27218dbf81e9a83225240a591e0dab97c3cb4 100755 (executable)
@@ -61,8 +61,8 @@ $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCR
 $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"
index db1b4a2bbe549f2b9679db0abb4ab382c3168177..7b03d86b2fa6397e57e8ee51654dbb4aba653e34 100755 (executable)
@@ -58,8 +58,8 @@ len=$((blocks * blksz))
 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"
index 5b811f9d4ec423f0d12b84e7eb48f7afa5d3ade4..45b7620530b482f22045448ca68e6f7e2f35bdad 100755 (executable)
@@ -53,8 +53,8 @@ len=$((blocks * rtextsz))
 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
index 58b7625c718b47d22b8156e74289c623aef74d12..186adaad259f9da9f6a0757794c3a5a1a55b741b 100755 (executable)
@@ -52,8 +52,8 @@ len=$((blocks * rtextsz))
 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
index 8430b1fe168db7a56dea72d0444d61cc6c4be475..fdf69bac841a4cebb266caace08789934e478d69 100755 (executable)
@@ -55,7 +55,7 @@ for i in $(seq 0 9); do
        done
 done
 
-cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
+cpus=$(( $($here/src/feature -o) * 4 * LOAD_FACTOR))
 
 echo "Concurrent repair"
 filter_output() {
index 85f8a0e9e56c9284d1160d834c7ee895fe1a1b04..a63f40284f60a048fdf266309f0df59ab9ba2799 100755 (executable)
@@ -44,7 +44,7 @@ _scratch_mount
 
 $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"
index 319e0888912cf70162b43938d8fde7776484ff09..54d603cf71609f2e5f35136bf8fceb1632358b4f 100755 (executable)
@@ -62,9 +62,9 @@ file2=$SCRATCH_MNT/file2
 # 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
index 7a33b9e9da430028a725f03efbf32400ce286717..6ed88715c5562993df0443414802a35f332692c2 100755 (executable)
@@ -57,7 +57,7 @@ mount_loop() {
        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
index ceba9ff67abfc0319efd89d06b996a20b591c37a..4778ce05a22f2bbcd147699d83af0b87fc7d9093 100755 (executable)
@@ -120,7 +120,7 @@ inumbers_count()
 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
 }
index c12b40907302f9cc4bfd54e1c3358031988b29e7..4a7684e7d62e785cbe394c5ac768e295150ebe4c 100755 (executable)
@@ -40,7 +40,7 @@ _supported_os Linux
 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