]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
populate: add _require_populate_commands to check for tools
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 21 Jan 2017 08:10:31 +0000 (00:10 -0800)
committerEryu Guan <eguan@redhat.com>
Tue, 24 Jan 2017 10:23:31 +0000 (18:23 +0800)
Back when I created common/populate, I thought it was sufficient to
_require the tools that the populate functions need in the main
file.  This turned out to be a bit sloppy, so move them into a
helper function and call it from everything that uses populate.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
27 files changed:
common/populate
tests/ext4/006
tests/xfs/083
tests/xfs/085
tests/xfs/086
tests/xfs/087
tests/xfs/088
tests/xfs/089
tests/xfs/091
tests/xfs/093
tests/xfs/097
tests/xfs/098
tests/xfs/099
tests/xfs/100
tests/xfs/101
tests/xfs/102
tests/xfs/105
tests/xfs/112
tests/xfs/113
tests/xfs/117
tests/xfs/120
tests/xfs/123
tests/xfs/124
tests/xfs/125
tests/xfs/126
tests/xfs/269
tests/xfs/273

index 164fdd34219e98987856a2573126616a3fe7e5a7..c19666a0936bbe68fef159034b00f14867f58986 100644 (file)
 #  Mountain View, CA 94043, USA, or: http://www.sgi.com
 #-----------------------------------------------------------------------
 
-_require_xfs_io_command "falloc"
-_require_xfs_io_command "fpunch"
-_require_test_program "punch-alternating"
+_require_populate_commands() {
+       _require_xfs_io_command "falloc"
+       _require_xfs_io_command "fpunch"
+       _require_test_program "punch-alternating"
+       _require_command "$XFS_DB_PROG" "xfs_db"
+}
 
 _require_xfs_db_blocktrash_z_command() {
        test "${FSTYP}" = "xfs" || _notrun "cannot run xfs_db on ${FSTYP}"
index f6cca66274243f6627587c9c405942bc41c9f7a3..9662f50bc7320d524fe43fd119e40d54befc81e0 100755 (executable)
@@ -54,6 +54,7 @@ _supported_os Linux
 
 _require_scratch
 _require_attrs
+_require_populate_commands
 
 repair_scratch() {
        fsck_pass="$1"
index 040f3b6cbf3c498154e5b94ab4e695425b94a20d..39bd75fcfc7575068ef50f26eeadef2fbd69e47a 100755 (executable)
@@ -48,12 +48,11 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_require_xfs_io_command "falloc"
-_require_xfs_io_command "fpunch"
 _require_scratch
 #_require_xfs_crc      # checksum not required, but you probably want it anyway...
 #_require_xfs_mkfs_crc
 _require_attrs
+_require_populate_commands
 
 scratch_repair() {
        fsck_pass="$1"
index 1ca5354f31ebcdc5e79169bafaef59968b1ee60d..0c85850d2a62ce8db2e1a8fe6272f9df5b02790c 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 
 rm -f $seqres.full
index cf0a71a71f97f5e210608614f3586593d4faad32..787f88650c60f96e2f374688f8ab59a41df37205 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 0bb3ec14901d977145830b811f2e0bcfed3a09f9..58ba9586cad630c4e3d859bafd71e96a1a922c1e 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index d6972a440aec2693c73842ff022d49193d119a51..36745b2ff52fe9039896f773d6f1fb8cffcc2f07 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 06996a5da2a9528fec33ca41b949fb7bc775065f..52bdd542957ef8460753d9dc8d243e5ee588ce29 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index a263cb0890e3ba1d673a6a9bcff5715221126cf3..ae6233707b8589d76486c34e4a20cc4a25603473 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 753231eaefec0e54b35ebafa637e5724c51efcbc..0f9311e9bcb537b6e94a61ae2fddd606c344f867 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index a75f06a4e98ae83e3ebfe1cb387bf25b56d0e40c..303ad04ff0badd2dd9018b5a06afb389367c5734 100755 (executable)
@@ -52,6 +52,7 @@ _require_xfs_mkfs_finobt
 _require_xfs_finobt
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 581377e2efa4c3a9110a00dfbdf5734358bb2531..7873f3226658213d5171a99889d5a04a56b8ec0f 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 85193ab8c8923d28ca34e9c31280a9f8e59ad5fa..7835df9f110ab66f4a477d7e6486d53bd4fbe031 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 3bfafce0b45c8446926e9b42817bace5af9bd2f8..ebb656d3b6084b66f73fdd9237946d0c3a31f137 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index d3abd1925e8d28f8cac7f45ef6e31a7237cffda1..709fc9d327e816aa3f27cd40033aab8ba6e16f91 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index cf0d7a6d06a7a7b379825459b35af23679cea09f..3d51c6a25e50055ef116586b05e8ed438f396f16 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 07ccf008bf2e61cd72c06914ae492f6ac2396f44..fc91a4f5ddc86f76a4eed455848f6622f4362109 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 84f1f1d0ab3f407a01215fc61ea26e120cc90a31..ae756845d209229a2c8b8e2f899ee0f63eb0d999 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index ec328bc2d58dce98e73217dabed9c2811a56a895..c347db78878234169af5d63ec3a647bf6b107b23 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index f251fb3df53507f90acf843c442824d78a3e1e08..f0b95aa14cf4b1cbfb0f56f6b13fabc13bdcd3e5 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 3deece62d85da55518ac177b34350101da8b5ada..5a38000c73883ca46a54efd7614acafa630ba467 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index e6cd8e77415c4806b13688a72940011dbf8b2e04..7355e86a4fc44a1d3d64b6fa6af8e18ecafb9ffe 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index cfea2e6fa59eb98dce4327fec79c52f213580ec0..a828dd6bb6a1c758046fef7a66db77f3d497fb68 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 3f2f6f00077223a250c0dc063a426b72f3875acc..3afb4cc1d0d58de938b636935fcf9b1fd62bb7a2 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index 77779e00f16ff73eeb9c508e952a866f6f372fe7..d696ff1f50496ba992487296133b7557cac649ac 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 _require_scratch
 test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc
 _require_attrs
+_require_populate_commands
 _require_xfs_db_blocktrash_z_command
 test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3"
 
index b51ce645d7b3fcc907d51e01a9493c1518c0b52a..318dd2288b8c4634f9115c74a1acd7b94f1b66bd 100755 (executable)
@@ -44,6 +44,7 @@ _cleanup()
 # real QA test starts here
 _supported_os Linux
 _require_scratch
+_require_populate_commands
 _require_test_program "attr-list-by-handle-cursor-test"
 
 rm -f "$seqres.full"
index f4b57bbeb9842de19c0c2b2187ce9093f3ae64ee..1a4ee9305ef623d343f0c811bc28877f57079759 100755 (executable)
@@ -44,6 +44,7 @@ _cleanup()
 _supported_os Linux
 _supported_fs xfs
 _require_scratch
+_require_populate_commands
 _require_xfs_io_command "fsmap"
 
 rm -f "$seqres.full"