From: Darrick J. Wong Date: Sat, 21 Jan 2017 08:10:31 +0000 (-0800) Subject: populate: add _require_populate_commands to check for tools X-Git-Tag: v2022.05.01~2210 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8eaf59b7c337151e107676e6b897efac4dcb603f;p=users%2Fhch%2Fxfstests-dev.git populate: add _require_populate_commands to check for tools 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/populate b/common/populate index 164fdd342..c19666a09 100644 --- a/common/populate +++ b/common/populate @@ -22,9 +22,12 @@ # 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}" diff --git a/tests/ext4/006 b/tests/ext4/006 index f6cca6627..9662f50bc 100755 --- a/tests/ext4/006 +++ b/tests/ext4/006 @@ -54,6 +54,7 @@ _supported_os Linux _require_scratch _require_attrs +_require_populate_commands repair_scratch() { fsck_pass="$1" diff --git a/tests/xfs/083 b/tests/xfs/083 index 040f3b6cb..39bd75fcf 100755 --- a/tests/xfs/083 +++ b/tests/xfs/083 @@ -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" diff --git a/tests/xfs/085 b/tests/xfs/085 index 1ca5354f3..0c85850d2 100755 --- a/tests/xfs/085 +++ b/tests/xfs/085 @@ -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 diff --git a/tests/xfs/086 b/tests/xfs/086 index cf0a71a71..787f88650 100755 --- a/tests/xfs/086 +++ b/tests/xfs/086 @@ -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" diff --git a/tests/xfs/087 b/tests/xfs/087 index 0bb3ec149..58ba9586c 100755 --- a/tests/xfs/087 +++ b/tests/xfs/087 @@ -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" diff --git a/tests/xfs/088 b/tests/xfs/088 index d6972a440..36745b2ff 100755 --- a/tests/xfs/088 +++ b/tests/xfs/088 @@ -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" diff --git a/tests/xfs/089 b/tests/xfs/089 index 06996a5da..52bdd5429 100755 --- a/tests/xfs/089 +++ b/tests/xfs/089 @@ -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" diff --git a/tests/xfs/091 b/tests/xfs/091 index a263cb089..ae6233707 100755 --- a/tests/xfs/091 +++ b/tests/xfs/091 @@ -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" diff --git a/tests/xfs/093 b/tests/xfs/093 index 753231eae..0f9311e9b 100755 --- a/tests/xfs/093 +++ b/tests/xfs/093 @@ -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" diff --git a/tests/xfs/097 b/tests/xfs/097 index a75f06a4e..303ad04ff 100755 --- a/tests/xfs/097 +++ b/tests/xfs/097 @@ -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" diff --git a/tests/xfs/098 b/tests/xfs/098 index 581377e2e..7873f3226 100755 --- a/tests/xfs/098 +++ b/tests/xfs/098 @@ -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" diff --git a/tests/xfs/099 b/tests/xfs/099 index 85193ab8c..7835df9f1 100755 --- a/tests/xfs/099 +++ b/tests/xfs/099 @@ -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" diff --git a/tests/xfs/100 b/tests/xfs/100 index 3bfafce0b..ebb656d3b 100755 --- a/tests/xfs/100 +++ b/tests/xfs/100 @@ -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" diff --git a/tests/xfs/101 b/tests/xfs/101 index d3abd1925..709fc9d32 100755 --- a/tests/xfs/101 +++ b/tests/xfs/101 @@ -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" diff --git a/tests/xfs/102 b/tests/xfs/102 index cf0d7a6d0..3d51c6a25 100755 --- a/tests/xfs/102 +++ b/tests/xfs/102 @@ -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" diff --git a/tests/xfs/105 b/tests/xfs/105 index 07ccf008b..fc91a4f5d 100755 --- a/tests/xfs/105 +++ b/tests/xfs/105 @@ -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" diff --git a/tests/xfs/112 b/tests/xfs/112 index 84f1f1d0a..ae756845d 100755 --- a/tests/xfs/112 +++ b/tests/xfs/112 @@ -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" diff --git a/tests/xfs/113 b/tests/xfs/113 index ec328bc2d..c347db788 100755 --- a/tests/xfs/113 +++ b/tests/xfs/113 @@ -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" diff --git a/tests/xfs/117 b/tests/xfs/117 index f251fb3df..f0b95aa14 100755 --- a/tests/xfs/117 +++ b/tests/xfs/117 @@ -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" diff --git a/tests/xfs/120 b/tests/xfs/120 index 3deece62d..5a38000c7 100755 --- a/tests/xfs/120 +++ b/tests/xfs/120 @@ -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" diff --git a/tests/xfs/123 b/tests/xfs/123 index e6cd8e774..7355e86a4 100755 --- a/tests/xfs/123 +++ b/tests/xfs/123 @@ -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" diff --git a/tests/xfs/124 b/tests/xfs/124 index cfea2e6fa..a828dd6bb 100755 --- a/tests/xfs/124 +++ b/tests/xfs/124 @@ -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" diff --git a/tests/xfs/125 b/tests/xfs/125 index 3f2f6f000..3afb4cc1d 100755 --- a/tests/xfs/125 +++ b/tests/xfs/125 @@ -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" diff --git a/tests/xfs/126 b/tests/xfs/126 index 77779e00f..d696ff1f5 100755 --- a/tests/xfs/126 +++ b/tests/xfs/126 @@ -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" diff --git a/tests/xfs/269 b/tests/xfs/269 index b51ce645d..318dd2288 100755 --- a/tests/xfs/269 +++ b/tests/xfs/269 @@ -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" diff --git a/tests/xfs/273 b/tests/xfs/273 index f4b57bbeb..1a4ee9305 100755 --- a/tests/xfs/273 +++ b/tests/xfs/273 @@ -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"