From 2f791546395cb43f3f93de6c095c812c7cd5237f Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 16 Feb 2014 15:22:56 +0000 Subject: tests: check commands needed for running a test exist Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- tests/functions.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index 5e2292d9b..191a310ac 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -37,7 +37,12 @@ function ts_report { else echo "$1" fi +} +function ts_check_test_command { + if [ ! -x "$1" ]; then + ts_skip "${1##*/} not found" + fi } function ts_skip_subtest { @@ -371,7 +376,7 @@ function ts_die { ts_log "$1" if [ -n "$2" ] && [ -b "$2" ]; then ts_device_deinit "$2" - ts_fstab_clean # for sure... + ts_fstab_clean # for sure... fi ts_finalize } @@ -384,7 +389,7 @@ function ts_image_md5sum { function ts_image_init { local mib=${1:-"5"} # size in MiBs local img=${2:-"$TS_OUTDIR/${TS_TESTNAME}.img"} - + dd if=/dev/zero of="$img" bs=1M count=$mib &> /dev/null echo "$img" return 0 -- cgit v1.2.3-55-g7522