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 <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-01-21 00:10:31 -08:00
committed by Eryu Guan
parent 7d8fc2aff3
commit 8eaf59b7c3
27 changed files with 32 additions and 5 deletions
+6 -3
View File
@@ -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}"