Skip to contentSkip to conversation

xfstests: Use _require_xfs_io_command() instead of helpers

PATCH In review Lukas Czerner 2 participants 2 messages Apr 24, 2014

lore
Share & tools
lore
#0 lore raw

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
index a4bc976..732cd64 100644
@@ -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
index 6c54590..c2ac561 100644
@@ -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
index b2dff1c..d615efd 100644
@@ -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
index f17f102..50cffd3 100644
@@ -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
index cc1936d..2dc6499 100755
@@ -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
index 8239f0e..827d806 100755
@@ -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
index 12be253..8cb3fd1 100755
@@ -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
index b4d3e4b..65abe3c 100644
@@ -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
index e689299..730625b 100755
@@ -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
index 13a4488..15a2551 100755
@@ -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
index 93a4045..13b7254 100755
@@ -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
index 7f3753a..eb88e01 100755
@@ -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
index 55e7206..55bf8c5 100755
@@ -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
index 3c8a304..c99520f 100755
@@ -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
index 1885534..444c1fe 100755
@@ -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
index 7b0e584..a67b8d5 100755
@@ -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
index 03d4491..7ac0872 100755
@@ -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
index dd329b4..8419065 100755
@@ -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
index cfe7237..e6cc7dc 100755
@@ -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
index 7c4887f..2d8d496 100755
@@ -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
index 4e07f8a..01d4600 100755
@@ -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
index 284b59d..e389049 100755
@@ -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
index eaec43c..1ed4962 100755
@@ -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
index 8cb2975..29a4331 100755
@@ -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
index 6b5402c..f13c14b 100755
@@ -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
index 00be41a..b2c4c08 100755
@@ -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
index cbe7108..55322ec 100755
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Lukas Czerner

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.

I like it.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs