mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs/24[356]: check for -c switch to xfs_io bmap command
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>
This commit is contained in:
committed by
Dave Chinner
parent
f9ff240882
commit
d172db236c
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user