diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-05-14 08:49:50 +0300 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2018-05-16 11:31:38 +0800 |
commit | ab4c48e3aee45b9aa1c4ac9a586bc3fa743dd438 (patch) | |
tree | ffc5fd096122a243fd9f0c0ed84597d2c8b2c2fa | |
parent | 5761a6eaade207e05f06ba1cad90bdf087cbb4d3 (diff) | |
download | xfstests-dev-ab4c48e3aee45b9aa1c4ac9a586bc3fa743dd438.tar.gz |
fstests: define and use TIMEOUT_PROG
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r-- | common/config | 1 | ||||
-rwxr-xr-x | tests/generic/297 | 4 | ||||
-rwxr-xr-x | tests/generic/298 | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/common/config b/common/config index cc3180694e..af360cefc8 100644 --- a/common/config +++ b/common/config @@ -204,6 +204,7 @@ export UBIUPDATEVOL_PROG="`set_prog_path ubiupdatevol`" export THIN_CHECK_PROG="$(set_prog_path thin_check)" export PYTHON2_PROG="`set_prog_path python2`" export SQLITE3_PROG="`set_prog_path sqlite3`" +export TIMEOUT_PROG="`set_prog_path timeout`" # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. # newer systems have udevadm command but older systems like RHEL5 don't. diff --git a/tests/generic/297 b/tests/generic/297 index f7eb37b98a..a3ba5c4faa 100755 --- a/tests/generic/297 +++ b/tests/generic/297 @@ -45,7 +45,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink -_require_command "$(which timeout)" "timeout" +_require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" @@ -83,7 +83,7 @@ kill_after=2 # give us a shorter time to die n=$(stat -c '%s' $testdir/file1) echo "performing kill test on $n bytes..." >> $seqres.full touch $TEST_DIR/before -timeout -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 +$TIMEOUT_PROG -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after) diff --git a/tests/generic/298 b/tests/generic/298 index b518da1db7..a4d458cf26 100755 --- a/tests/generic/298 +++ b/tests/generic/298 @@ -45,7 +45,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink -_require_command "$(which timeout)" "timeout" +_require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" @@ -83,7 +83,7 @@ kill_after=2 # give us a shorter time to die n=$(stat -c '%s' $testdir/file1) echo "performing kill test on $n bytes..." >> $seqres.full touch $TEST_DIR/before -urk=$(timeout -s KILL ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1) +urk=$($TIMEOUT_PROG -s KILL ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1) touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after) |