#! /bin/bash
-# FS QA Test No. 286
-#
-# SEEK_DATA/SEEK_HOLE copy tests.
-#
-#-----------------------------------------------------------------------
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2011 Oracle Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# FS QA Test No. 286
#
-#-----------------------------------------------------------------------
+# SEEK_DATA/SEEK_HOLE copy tests.
#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_supported_fs generic
_supported_os Linux
+_require_test
+_require_xfs_io_command "falloc"
_require_seek_data_hole
src=$TEST_DIR/seek_copy_testfile
dest=$TEST_DIR/seek_copy_testfile.dest
-[ -x $here/src/seek_copy_test ] || _notrun "seek_copy_test not built"
+_require_test_program "seek_copy_test"
_cleanup()
{
$here/src/seek_copy_test $src $dest
- test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+ test $(_get_filesize $src) = $(_get_filesize $dest) ||
_fail "TEST01: file size check failed"
cmp $src $dest || _fail "TEST01: file bytes check failed"
$here/src/seek_copy_test $src $dest
- test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+ test $(_get_filesize $src) = $(_get_filesize $dest) ||
_fail "TEST02: file size check failed"
cmp $src $dest || _fail "TEST02: file bytes check failed"
echo >>$seqres.full
$here/src/seek_copy_test $src $dest
- test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+ test $(_get_filesize $src) = $(_get_filesize $dest) ||
_fail "TEST03: file size check failed"
cmp $src $dest || _fail "TEST03: file bytes check failed"
echo >>$seqres.full
$here/src/seek_copy_test $src $dest
- test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+ test $(_get_filesize $src) = $(_get_filesize $dest) ||
_fail "TEST04: file size check failed"
cmp $src $dest || _fail "TEST04: file bytes check failed"