]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/24[356]: check for -c switch to xfs_io bmap command
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 18 Feb 2016 23:51:25 +0000 (10:51 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Feb 2016 23:51:25 +0000 (10:51 +1100)
Extend _require_xfs_io_command so that we can pass it a command line
argument to look for, and then use new capabililty in the relevant
tests to ensure that bmap knows how to dump CoW fork contents (bmap -c)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/xfs/243
tests/xfs/245
tests/xfs/246

index 0dc3f0fa6f033c362121b9f52a8a5ee7aea3f1e4..3e98bcb8544dc8cb064843213f4e4c4da6b67e09 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1852,12 +1852,13 @@ _user_do()
 
 _require_xfs_io_command()
 {
-       if [ $# -ne 1 ]
+       if [ -z "$1" ]
        then
-               echo "Usage: _require_xfs_io_command command" 1>&2
+               echo "Usage: _require_xfs_io_command command [switch]" 1>&2
                exit 1
        fi
        command=$1
+       param=$2
 
        testfile=$TEST_DIR/$$.xfs_io
        case $command in
@@ -1887,6 +1888,10 @@ _require_xfs_io_command()
                _notrun "xfs_io $command support is missing"
        echo $testio | grep -q "Operation not supported" && \
                _notrun "xfs_io $command failed (old kernel/wrong fs?)"
+
+       test -z "$param" && return
+       $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \
+               _notrun "xfs_io $command doesn't support $param"
 }
 
 # check that xfs_db supports a specific command
index b616adfdb3ebfde02afbaa32b4673e25050418eb..f6a86924143c38d07f4a37e611228c94217efffd 100755 (executable)
@@ -56,6 +56,7 @@ _supported_fs xfs
 _require_scratch_reflink
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fpunch"
+_require_xfs_io_command "bmap" "-c"
 _require_cp_reflink
 
 rm -f $seqres.full
index c7455926d89bf324d156db6d68d6bd59b5224503..c668eebc9042ecd98d761df7e34e532468ed56e1 100755 (executable)
@@ -49,6 +49,7 @@ _supported_os Linux
 _supported_fs xfs
 _require_scratch_reflink
 _require_xfs_io_command "falloc"
+_require_xfs_io_command "bmap" "-c"
 _require_cp_reflink
 
 rm -f $seqres.full
index 13b0c982d212e86b4e4245a561efdca37ff62242..bf471ccd46e8747a601ffd502967031baaa293f3 100755 (executable)
@@ -42,6 +42,7 @@ _cleanup()
 # real QA test starts here
 _supported_os Linux
 _supported_fs xfs
+_require_xfs_io_command "bmap" "-c"
 
 rm -f $seqres.full