xfstests: Use _require_xfs_io_command() instead of helpers
PATCH 1/1 xfstests: 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.
--- common/defrag | 2 +- common/rc | 41 ----------------------------------------- tests/btrfs/026 | 2 +- tests/btrfs/027 | 2 +- tests/btrfs/028 | 2 +- tests/btrfs/047 | 2 +- tests/ext4/001 | 2 +- tests/ext4/002 | 2 +- tests/generic/009 | 2 +- tests/generic/012 | 8 ++++---- tests/generic/016 | 8 ++++---- tests/generic/017 | 4 ++-- tests/generic/021 | 8 ++++---- tests/generic/022 | 8 ++++---- tests/generic/213 | 2 +- tests/generic/214 | 2 +- tests/generic/223 | 2 +- tests/generic/228 | 2 +- tests/generic/255 | 6 +++--- tests/generic/256 | 2 +- tests/generic/274 | 2 +- tests/generic/300 | 4 ++-- tests/generic/311 | 2 +- tests/generic/312 | 2 +- tests/generic/316 | 4 ++-- tests/shared/298 | 2 +- tests/xfs/252 | 4 ++-- tests/xfs/290 | 2 +- 28 files changed, 45 insertions(+), 86 deletions(-)
common/defrag +1 -1
@@ -38,7 +38,7 @@ _require_defrag() esac _require_command $DEFRAG_PROG - _require_xfs_io_fiemap + _require_xfs_io_command "fiemap" } _extent_count()
common/rc +0 -41
47 lines not on this page · raw message
tests/btrfs/026 +1 -1
@@ -48,7 +48,7 @@ _cleanup() _supported_fs btrfs _supported_os Linux -_require_xfs_io_fiemap +_require_xfs_io_command "fiemap" _require_cp_reflink TESTDIR1=$TEST_DIR/test-$seq
tests/btrfs/027 +1 -1
@@ -48,7 +48,7 @@ _cleanup() _supported_fs btrfs _supported_os Linux -_require_xfs_io_fiemap +_require_xfs_io_command "fiemap" _require_cp_reflink TESTDIR1=$TEST_DIR/test-$seq
tests/btrfs/028 +1 -1
@@ -46,7 +46,7 @@ _cleanup() _supported_fs btrfs _supported_os Linux -_require_xfs_io_fiemap +_require_xfs_io_command "fiemap" _require_cp_reflink rm -f $seqres.full
tests/btrfs/047 +1 -1
@@ -59,7 +59,7 @@ _supported_fs btrfs _supported_os Linux _require_scratch _require_fssum -_require_xfs_io_fiemap +_require_xfs_io_command "fiemap" _require_btrfs_send_stream_version _need_to_be_root
tests/ext4/001 +1 -1
@@ -45,7 +45,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs ext4 _supported_os Linux -_require_xfs_io_falloc_zero +_require_xfs_io_command "fzero" testfile=$TEST_DIR/001.$$
tests/ext4/002 +1 -1
@@ -119,7 +119,7 @@ _check_ext4_eof_flag() # Prerequisites for the test run. _supported_fs ext4 _supported_os Linux -_require_xfs_io_falloc +_require_xfs_io_command "falloc" # Real QA test starts here. rm -f $seqres.full
tests/generic/009 +1 -1
@@ -44,7 +44,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_os Linux -_require_xfs_io_falloc_zero +_require_xfs_io_command "fzero" testfile=$TEST_DIR/009.$$
tests/generic/012 +4 -4
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_falloc -_require_xfs_io_fiemap -_require_xfs_io_falloc_collapse +_require_xfs_io_command "fpunch" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fiemap" +_require_xfs_io_command "fcollapse" testfile=$TEST_DIR/$seq.$$
tests/generic/016 +4 -4
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_falloc -_require_xfs_io_fiemap -_require_xfs_io_falloc_collapse +_require_xfs_io_command "fpunch" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fiemap" +_require_xfs_io_command "fcollapse" testfile=$TEST_DIR/$seq.$$
tests/generic/017 +2 -2
@@ -43,8 +43,8 @@ _supported_fs generic _supported_os Linux _require_scratch -_require_xfs_io_fiemap -_require_xfs_io_falloc_collapse +_require_xfs_io_command "fiemap" +_require_xfs_io_command "fcollapse" _do_die_on_error=y testfile=$SCRATCH_MNT/$seq.$$ BLOCKS=10240
tests/generic/021 +4 -4
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_falloc -_require_xfs_io_fiemap -_require_xfs_io_falloc_collapse +_require_xfs_io_command "fpunch" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fiemap" +_require_xfs_io_command "fcollapse" testfile=$TEST_DIR/$seq.$$
tests/generic/022 +4 -4
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_falloc -_require_xfs_io_fiemap -_require_xfs_io_falloc_collapse +_require_xfs_io_command "fpunch" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fiemap" +_require_xfs_io_command "fcollapse" testfile=$TEST_DIR/$seq.$$
tests/generic/213 +1 -1
@@ -54,7 +54,7 @@ _supported_os Linux rm -f $seqres.full -_require_xfs_io_falloc +_require_xfs_io_command "falloc" # check there's enough freespace on $TEST_DIR ... (1GiB + 1MiB) avail=`df -P $TEST_DIR | awk 'END {print $4}'`
tests/generic/214 +1 -1
@@ -53,7 +53,7 @@ _supported_os Linux rm -f $seqres.full rm -f $TEST_DIR/ouch* -_require_xfs_io_falloc +_require_xfs_io_command "falloc" # Ok, off we go.
tests/generic/223 +1 -1
@@ -46,7 +46,7 @@ _supported_fs generic _supported_os Linux _require_scratch -_require_xfs_io_falloc +_require_xfs_io_command "falloc" rm -f $seqres.full
tests/generic/228 +1 -1
@@ -53,7 +53,7 @@ _supported_os Linux rm -f $seqres.full # Sanity check to see if fallocate works -_require_xfs_io_falloc +_require_xfs_io_command "falloc" # Check if we have good enough space available avail=`df -P $TEST_DIR | awk 'END {print $4}'`
tests/generic/255 +3 -3
@@ -46,9 +46,9 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_falloc -_require_xfs_io_fiemap +_require_xfs_io_command "fpunch" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fiemap" testfile=$TEST_DIR/255.$$
tests/generic/256 +1 -1
@@ -46,7 +46,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch +_require_xfs_io_command "fpunch" _require_scratch _require_user
tests/generic/274 +1 -1
@@ -48,7 +48,7 @@ _cleanup() _supported_fs generic _supported_os IRIX Linux _require_scratch -_require_xfs_io_falloc +_require_xfs_io_command "falloc" echo "------------------------------" echo "preallocation test"
tests/generic/300 +2 -2
@@ -46,8 +46,8 @@ _require_scratch # xfs_io is not required for this test, but it's the best way to verify # the test system supports fallocate() for allocation and hole punching -_require_xfs_io_falloc -_require_xfs_io_falloc_punch +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" rm -f $seqres.full
tests/generic/311 +1 -1
@@ -59,7 +59,7 @@ _require_dm_flakey # xfs_io is not required for this test, but it's the best way to verify # the test system supports fallocate() for allocation -_require_xfs_io_falloc +_require_xfs_io_command "falloc" [ -x $here/src/fsync-tester ] || _notrun "fsync-tester not built"
tests/generic/312 +1 -1
@@ -46,7 +46,7 @@ _cleanup() # real QA test starts here _supported_fs generic _supported_os Linux -_require_xfs_io_falloc +_require_xfs_io_command "falloc" _require_scratch # 5G in byte
tests/generic/316 +2 -2
@@ -45,8 +45,8 @@ _cleanup() _supported_fs generic _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_fiemap +_require_xfs_io_command "fpunch" +_require_xfs_io_command "fiemap" testfile=$TEST_DIR/$seq.$$
tests/shared/298 +1 -1
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs ext4 xfs _supported_os Linux _require_fstrim -_require_xfs_io_fiemap +_require_xfs_io_command "fiemap" _require_fs_space $TEST_DIR 307200 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
tests/xfs/252 +2 -2
@@ -46,8 +46,8 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs xfs _supported_os Linux -_require_xfs_io_falloc_punch -_require_xfs_io_fiemap +_require_xfs_io_command "fpunch" +_require_xfs_io_command "fiemap" testfile=$TEST_DIR/252.$$
tests/xfs/290 +1 -1
@@ -46,7 +46,7 @@ trap "exit \$status" 0 1 2 3 15 _supported_fs xfs _supported_os Linux -_require_xfs_io_zero +_require_xfs_io_command "zero" testfile=$TEST_DIR/290.$$
Signature · 6 lines
1.8.3.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Lukas Czerner
Number of helpers for checking
xfs_iofunctionality 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 inxfs_io.Remove all the helpers and use
_require_xfs_io_command()in the tests.Signed-off-by Lukas Czerner <[email protected]>
I like it.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs