common: Use _require_xfs_io_command() instead of helpers

Number of helpers for checking xfs_io functionality is slowly
growing.  But it's as easy to simply use _require_xfs_io_command()
directly and just specify the command we want to check. It will also
avoid the need to create helper every time we need to check a new
command in xfs_io.

Remove all the helpers and use _require_xfs_io_command() in the
tests.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Lukas Czerner
2014-04-28 10:55:12 +10:00
committed by Dave Chinner
parent a841a6d0a8
commit ce0aa2bc5c
28 changed files with 45 additions and 86 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ _require_defrag()
esac esac
_require_command $DEFRAG_PROG _require_command $DEFRAG_PROG
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
} }
_extent_count() _extent_count()
-41
View File
@@ -1260,47 +1260,6 @@ _require_xfs_io_command()
_notrun "xfs_io $command failed (old kernel/wrong fs?)" _notrun "xfs_io $command failed (old kernel/wrong fs?)"
} }
# check that xfs_io, kernel, and filesystem all support zero
_require_xfs_io_zero()
{
_require_xfs_io_command "zero"
}
# check that xfs_io, glibc, kernel, and filesystem all (!) support
# fallocate
#
_require_xfs_io_falloc()
{
_require_xfs_io_command "falloc"
}
# check that xfs_io, kernel and filesystem all support fallocate with hole
# punching
_require_xfs_io_falloc_punch()
{
_require_xfs_io_command "fpunch"
}
# check that xfs_io, kernel and filesystem all support fallocate with collapse
# range
_require_xfs_io_falloc_collapse()
{
_require_xfs_io_command "fcollapse"
}
# check that xfs_io, kernel, and filesystem all support fallocate with zero
# range
_require_xfs_io_falloc_zero()
{
_require_xfs_io_command "fzero"
}
# check that xfs_io, kernel and filesystem support fiemap
_require_xfs_io_fiemap()
{
_require_xfs_io_command "fiemap"
}
# Check that a fs has enough free space (in 1024b blocks) # Check that a fs has enough free space (in 1024b blocks)
# #
_require_fs_space() _require_fs_space()
+1 -1
View File
@@ -48,7 +48,7 @@ _cleanup()
_supported_fs btrfs _supported_fs btrfs
_supported_os Linux _supported_os Linux
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_cp_reflink _require_cp_reflink
TESTDIR1=$TEST_DIR/test-$seq TESTDIR1=$TEST_DIR/test-$seq
+1 -1
View File
@@ -48,7 +48,7 @@ _cleanup()
_supported_fs btrfs _supported_fs btrfs
_supported_os Linux _supported_os Linux
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_cp_reflink _require_cp_reflink
TESTDIR1=$TEST_DIR/test-$seq TESTDIR1=$TEST_DIR/test-$seq
+1 -1
View File
@@ -46,7 +46,7 @@ _cleanup()
_supported_fs btrfs _supported_fs btrfs
_supported_os Linux _supported_os Linux
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_cp_reflink _require_cp_reflink
rm -f $seqres.full rm -f $seqres.full
+1 -1
View File
@@ -59,7 +59,7 @@ _supported_fs btrfs
_supported_os Linux _supported_os Linux
_require_scratch _require_scratch
_require_fssum _require_fssum
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_btrfs_send_stream_version _require_btrfs_send_stream_version
_need_to_be_root _need_to_be_root
+1 -1
View File
@@ -45,7 +45,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
# real QA test starts here # real QA test starts here
_supported_fs ext4 _supported_fs ext4
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_zero _require_xfs_io_command "fzero"
testfile=$TEST_DIR/001.$$ testfile=$TEST_DIR/001.$$
+1 -1
View File
@@ -119,7 +119,7 @@ _check_ext4_eof_flag()
# Prerequisites for the test run. # Prerequisites for the test run.
_supported_fs ext4 _supported_fs ext4
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc _require_xfs_io_command "falloc"
# Real QA test starts here. # Real QA test starts here.
rm -f $seqres.full rm -f $seqres.full
+1 -1
View File
@@ -44,7 +44,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
# real QA test starts here # real QA test starts here
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_zero _require_xfs_io_command "fzero"
testfile=$TEST_DIR/009.$$ testfile=$TEST_DIR/009.$$
+4 -4
View File
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_xfs_io_falloc _require_xfs_io_command "falloc"
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_xfs_io_falloc_collapse _require_xfs_io_command "fcollapse"
testfile=$TEST_DIR/$seq.$$ testfile=$TEST_DIR/$seq.$$
+4 -4
View File
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_xfs_io_falloc _require_xfs_io_command "falloc"
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_xfs_io_falloc_collapse _require_xfs_io_command "fcollapse"
testfile=$TEST_DIR/$seq.$$ testfile=$TEST_DIR/$seq.$$
+2 -2
View File
@@ -43,8 +43,8 @@ _supported_fs generic
_supported_os Linux _supported_os Linux
_require_scratch _require_scratch
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_xfs_io_falloc_collapse _require_xfs_io_command "fcollapse"
_do_die_on_error=y _do_die_on_error=y
testfile=$SCRATCH_MNT/$seq.$$ testfile=$SCRATCH_MNT/$seq.$$
BLOCKS=10240 BLOCKS=10240
+4 -4
View File
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_xfs_io_falloc _require_xfs_io_command "falloc"
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_xfs_io_falloc_collapse _require_xfs_io_command "fcollapse"
testfile=$TEST_DIR/$seq.$$ testfile=$TEST_DIR/$seq.$$
+4 -4
View File
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_xfs_io_falloc _require_xfs_io_command "falloc"
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
_require_xfs_io_falloc_collapse _require_xfs_io_command "fcollapse"
testfile=$TEST_DIR/$seq.$$ testfile=$TEST_DIR/$seq.$$
+1 -1
View File
@@ -54,7 +54,7 @@ _supported_os Linux
rm -f $seqres.full rm -f $seqres.full
_require_xfs_io_falloc _require_xfs_io_command "falloc"
# check there's enough freespace on $TEST_DIR ... (1GiB + 1MiB) # check there's enough freespace on $TEST_DIR ... (1GiB + 1MiB)
avail=`df -P $TEST_DIR | awk 'END {print $4}'` avail=`df -P $TEST_DIR | awk 'END {print $4}'`
+1 -1
View File
@@ -53,7 +53,7 @@ _supported_os Linux
rm -f $seqres.full rm -f $seqres.full
rm -f $TEST_DIR/ouch* rm -f $TEST_DIR/ouch*
_require_xfs_io_falloc _require_xfs_io_command "falloc"
# Ok, off we go. # Ok, off we go.
+1 -1
View File
@@ -46,7 +46,7 @@ _supported_fs generic
_supported_os Linux _supported_os Linux
_require_scratch _require_scratch
_require_xfs_io_falloc _require_xfs_io_command "falloc"
rm -f $seqres.full rm -f $seqres.full
+1 -1
View File
@@ -53,7 +53,7 @@ _supported_os Linux
rm -f $seqres.full rm -f $seqres.full
# Sanity check to see if fallocate works # Sanity check to see if fallocate works
_require_xfs_io_falloc _require_xfs_io_command "falloc"
# Check if we have good enough space available # Check if we have good enough space available
avail=`df -P $TEST_DIR | awk 'END {print $4}'` avail=`df -P $TEST_DIR | awk 'END {print $4}'`
+3 -3
View File
@@ -46,9 +46,9 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_xfs_io_falloc _require_xfs_io_command "falloc"
_require_xfs_io_fiemap _require_xfs_io_command "fiemap"
testfile=$TEST_DIR/255.$$ testfile=$TEST_DIR/255.$$
+1 -1
View File
@@ -46,7 +46,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_xfs_io_falloc_punch _require_xfs_io_command "fpunch"
_require_scratch _require_scratch
_require_user _require_user

Some files were not shown because too many files have changed in this diff Show More